]> pd.if.org Git - pdclib/blob - functions/math/ceil.c
Merged PDPCLIB and Therx code.
[pdclib] / functions / math / ceil.c
1 // ----------------------------------------------------------------------------
2 // $Id$
3 // ----------------------------------------------------------------------------
4 // Public Domain C Library - http://pdclib.sourceforge.net
5 // This code is Public Domain. Use, modify, and redistribute at will.
6 // ----------------------------------------------------------------------------
7
8 // ----------------------------------------------------------------------------
9 // C++
10
11 float ceil( float x ) { /* TODO */ };
12 long double ceil( long double x ) { /* TODO */ };
13
14 // ----------------------------------------------------------------------------
15 // Standard C
16
17 double ceil( double x ) { /* TODO */ };
18
19 /* Therx code
20 {
21     return ( x < 0 ) ? (int) x : ( (int) x ) + 1;
22 }
23 */
24
25 /* PDPC code - unreviewed
26 {
27     int y;
28     
29     y = (int)x;
30     if ((double)y < x)
31     {
32         y++;
33     }
34     return ((double)y);
35 }
36 */
37
38 float ceilf( float x ) { /* TODO */ };
39 long double ceill( long double x ) { /* TODO */ };