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 0966763..66bcb62 100644 (file)
     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));
+}
+