X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fmath%2Fceil.c;h=d1ebdeeee0ca412218f1a6bf0ee90f77739fc685;hp=11eb88f8e536a279fbff89f377c140771b01bafd;hb=0a5395faab237ba9008352b0f4bee9659bbd3d5f;hpb=34893ecc2200dc7017c36a54cb6c5f4c2378b5ec diff --git a/functions/math/ceil.c b/functions/math/ceil.c index 11eb88f..d1ebdee 100644 --- a/functions/math/ceil.c +++ b/functions/math/ceil.c @@ -15,5 +15,25 @@ long double ceil( long double x ) { /* TODO */ }; // Standard C double ceil( double x ) { /* TODO */ }; + +/* Therx code +{ + return ( x < 0 ) ? (int) x : ( (int) x ) + 1; +} +*/ + +/* PDPC code - unreviewed +{ + int y; + + y = (int)x; + if ((double)y < x) + { + y++; + } + return ((double)y); +} +*/ + float ceilf( float x ) { /* TODO */ }; long double ceill( long double x ) { /* TODO */ };