diff options
Diffstat (limited to 'winsup/mingw/mingwex/math/lround.c')
-rw-r--r-- | winsup/mingw/mingwex/math/lround.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/winsup/mingw/mingwex/math/lround.c b/winsup/mingw/mingwex/math/lround.c deleted file mode 100644 index 7ee50df90..000000000 --- a/winsup/mingw/mingwex/math/lround.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <math.h> -#include <limits.h> -#include <errno.h> - -long -lround (double x) -{ - /* Add +/- 0.5 then then round towards zero. */ - double tmp = trunc (x + (x >= 0.0 ? 0.5 : -0.5)); - if (!isfinite (tmp) - || tmp > (double)LONG_MAX - || tmp < (double)LONG_MIN) - { - errno = ERANGE; - /* Undefined behaviour, so we could return anything. */ - /* return tmp > 0.0 ? LONG_MAX : LONG_MIN; */ - } - return (long)tmp; -} |