diff options
author | Keith Marshall <keithmarshall@@users.sf.net> | 2008-06-03 18:42:21 +0000 |
---|---|---|
committer | Keith Marshall <keithmarshall@@users.sf.net> | 2008-06-03 18:42:21 +0000 |
commit | 47140f3cdb70329a1948d6ab7c58c04e4e7a4b02 (patch) | |
tree | 059315829179e7bfa0f4dedd76405059095a41dd /winsup/mingw/mingwex/math/llroundf.c | |
parent | 585cd03044db704f7038592b6a183dd0b3550076 (diff) | |
download | cygnal-47140f3cdb70329a1948d6ab7c58c04e4e7a4b02.tar.gz cygnal-47140f3cdb70329a1948d6ab7c58c04e4e7a4b02.tar.bz2 cygnal-47140f3cdb70329a1948d6ab7c58c04e4e7a4b02.zip |
Avoid precision errors in round(), lround() and llround() functions.
Diffstat (limited to 'winsup/mingw/mingwex/math/llroundf.c')
-rw-r--r-- | winsup/mingw/mingwex/math/llroundf.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/winsup/mingw/mingwex/math/llroundf.c b/winsup/mingw/mingwex/math/llroundf.c deleted file mode 100644 index 6a6e9b51e..000000000 --- a/winsup/mingw/mingwex/math/llroundf.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <math.h> -#include <limits.h> -#include <errno.h> - -long long -llroundf (float x) -{ - /* Add +/- 0.5, then round towards zero. */ - float tmp = truncf (x + (x >= 0.0F ? 0.5F : -0.5F)); - if (!isfinite (tmp) - || tmp > (float)LONG_LONG_MAX - || tmp < (float)LONG_LONG_MIN) - { - errno = ERANGE; - /* Undefined behaviour, so we could return anything. */ - /* return tmp > 0.0F ? LONG_LONG_MAX : LONG_LONG_MIN; */ - } - return (long long)tmp; -} |