]> pd.if.org Git - pdclib/blobdiff - functions/math/ceil.c
Merged PDPCLIB and Therx code.
[pdclib] / functions / math / ceil.c
index 11eb88f8e536a279fbff89f377c140771b01bafd..d1ebdeeee0ca412218f1a6bf0ee90f77739fc685 100644 (file)
@@ -15,5 +15,25 @@ long double ceil( long double x ) { /* TODO */ };
 // Standard C
 
 double ceil( double x ) { /* TODO */ };
+
+/* Therx code
+{
+    return ( x < 0 ) ? (int) x : ( (int) x ) + 1;
+}
+*/
+
+/* PDPC code - unreviewed
+{
+    int y;
+    
+    y = (int)x;
+    if ((double)y < x)
+    {
+        y++;
+    }
+    return ((double)y);
+}
+*/
+
 float ceilf( float x ) { /* TODO */ };
 long double ceill( long double x ) { /* TODO */ };