]> pd.if.org Git - pdclib/blobdiff - functions/math/floor.c
Re-import from Subversion.
[pdclib] / functions / math / floor.c
index 30cc4630d39b0665d75d0a5545af276f6e4ec132..7d62107e17f7bac1332d38c7a7ae197aa00c16b7 100644 (file)
@@ -1,19 +1,37 @@
-// ----------------------------------------------------------------------------
-// $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 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 */ };