X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fmath%2Fceil.c;h=4c1e7bd276acc6c192886672650a314325ffbef5;hp=11eb88f8e536a279fbff89f377c140771b01bafd;hb=1d9d92ba957a0b8307c9a65c35867fde68e6533b;hpb=34893ecc2200dc7017c36a54cb6c5f4c2378b5ec diff --git a/functions/math/ceil.c b/functions/math/ceil.c index 11eb88f..4c1e7bd 100644 --- a/functions/math/ceil.c +++ b/functions/math/ceil.c @@ -1,19 +1,30 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * 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 */ };