// This code is Public Domain. Use, modify, and redistribute at will.
// ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------
-// C++
+double floor( double x ) { /* TODO */ };
-float floor( float x ) { /* TODO */ };
-long double floor( long double x ) { /* TODO */ };
+/* Therx code
+{
+ return ( x > 0 ) ? (int) x : (int) ( x - 0.9999999999999999 );
+}
+*/
-// ----------------------------------------------------------------------------
-// Standard C
+/* PDPC code - unreviewed
+{
+ int y;
+
+ if (x < 0.0)
+ {
+ y = (int)fabs(x);
+ if ((double)y != x)
+ {
+ y--;
+ }
+ }
+ else
+ {
+ y = (int)x;
+ }
+ return ((double)x);
+}
+*/
-double floor( double x ) { /* TODO */ };
float floorf( float x ) { /* TODO */ };
long double floorl( long double x ) { /* TODO */ };