added roundl to libnotimpl
authorJohn Crispin <john@openwrt.org>
Tue, 9 Oct 2007 20:02:04 +0000 (20:02 +0000)
committerJohn Crispin <john@openwrt.org>
Tue, 9 Oct 2007 20:02:04 +0000 (20:02 +0000)
SVN-Revision: 9221

libs/libnotimpl/src/math.c

index 096676371c178ba618fb4d2842249f15e2eae216..66bcb6292f195da58edd621c87f899c99123f9b7 100644 (file)
     return (float) expf( (double)x );
 }
 
     return (float) expf( (double)x );
 }
 
+/* lround for uClibc
+ *
+ * wrapper for lround(x)
+ */
+
+#ifdef __STDC__
+    long lround(double x)
+#else
+    long lround(x)
+    double x;
+#endif
+{
+    return (long) ((x - ((long)x) >= 0.5f) ? (((long)x) + 1) : ((long)x));
+}
+