From: John Crispin Date: Tue, 9 Oct 2007 20:02:04 +0000 (+0000) Subject: added roundl to libnotimpl X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e9dc7a2e95c27be4b6daee74a272a34bbb834c0c;p=openwrt%2Fsvn-archive%2Fpackages.git added roundl to libnotimpl SVN-Revision: 9221 --- diff --git a/libs/libnotimpl/src/math.c b/libs/libnotimpl/src/math.c index 096676371..66bcb6292 100644 --- a/libs/libnotimpl/src/math.c +++ b/libs/libnotimpl/src/math.c @@ -96,3 +96,18 @@ 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)); +} +