From e9dc7a2e95c27be4b6daee74a272a34bbb834c0c Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 9 Oct 2007 20:02:04 +0000 Subject: [PATCH] added roundl to libnotimpl SVN-Revision: 9221 --- libs/libnotimpl/src/math.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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)); +} + -- 2.30.2