X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fmath%2Fceil.c;h=c5e6f95000ffbe18b2b7151ccc798be19c981205;hb=e081ed1387e0c27dc689c8e32fdda06039544107;hp=11eb88f8e536a279fbff89f377c140771b01bafd;hpb=34893ecc2200dc7017c36a54cb6c5f4c2378b5ec;p=pdclib diff --git a/functions/math/ceil.c b/functions/math/ceil.c index 11eb88f..c5e6f95 100644 --- a/functions/math/ceil.c +++ b/functions/math/ceil.c @@ -5,15 +5,26 @@ // This code is Public Domain. Use, modify, and redistribute at will. // ---------------------------------------------------------------------------- -// ---------------------------------------------------------------------------- -// C++ +double ceil( double x ) { /* TODO */ }; -float ceil( float x ) { /* TODO */ }; -long double ceil( long double x ) { /* TODO */ }; +/* Therx code +{ + return ( x < 0 ) ? (int) x : ( (int) x ) + 1; +} +*/ -// ---------------------------------------------------------------------------- -// Standard C +/* PDPC code - unreviewed +{ + int y; + + y = (int)x; + if ((double)y < x) + { + y++; + } + return ((double)y); +} +*/ -double ceil( double x ) { /* TODO */ }; float ceilf( float x ) { /* TODO */ }; long double ceill( long double x ) { /* TODO */ };