]> pd.if.org Git - pdclib/blob - functions/math/floor.c
Re-import from Subversion.
[pdclib] / functions / math / floor.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 double floor( double x ) { /* TODO */ };
9
10 /* Therx code
11 {
12     return ( x > 0 ) ? (int) x : (int) ( x - 0.9999999999999999 );
13 }
14 */
15
16 /* PDPC code - unreviewed
17 {
18     int y;
19     
20     if (x < 0.0)
21     {
22         y = (int)fabs(x);
23         if ((double)y != x)
24         {
25             y--;
26         }
27     }
28     else
29     {
30         y = (int)x;
31     }
32     return ((double)x);
33 }
34 */
35
36 float floorf( float x ) { /* TODO */ };
37 long double floorl( long double x ) { /* TODO */ };