X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fmath%2Fceil.c;h=4c1e7bd276acc6c192886672650a314325ffbef5;hb=c8f799d852e3698468a78954d82588e841cc0b70;hp=11eb88f8e536a279fbff89f377c140771b01bafd;hpb=dcc8a8e99f69e090a03b7b868443addbc0817820;p=pdclib.old 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 */ };