diff options
author | stefanf <stefanf@FreeBSD.org> | 2005-04-28 19:45:55 +0000 |
---|---|---|
committer | stefanf <stefanf@FreeBSD.org> | 2005-04-28 19:45:55 +0000 |
commit | 16dd1d18f543b649ff5cfcd9b5c5c9069b33a218 (patch) | |
tree | 399a9854e18fb3743906a3dc42ba32ef9a4a8061 /lib/msun/src/s_floorl.c | |
parent | d8dbaeb308e2bb88b0eebab250c74380781bee0a (diff) | |
download | FreeBSD-src-16dd1d18f543b649ff5cfcd9b5c5c9069b33a218.zip FreeBSD-src-16dd1d18f543b649ff5cfcd9b5c5c9069b33a218.tar.gz |
Revert the last change, the conversion from long double to double can raise
unwanted underflow exceptions.
Pointed out by: das
Diffstat (limited to 'lib/msun/src/s_floorl.c')
-rw-r--r-- | lib/msun/src/s_floorl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/msun/src/s_floorl.c b/lib/msun/src/s_floorl.c index d7d3fcf..9dd13b6 100644 --- a/lib/msun/src/s_floorl.c +++ b/lib/msun/src/s_floorl.c @@ -50,7 +50,7 @@ static char rcsid[] = "$FreeBSD$"; } while (0) #endif -static const double huge = 1.0e300; +static const long double huge = 1.0e300; long double floorl(long double x) @@ -60,7 +60,7 @@ floorl(long double x) if (e < MANH_SIZE - 1) { if (e < 0) { /* raise inexact if x != 0 */ - if (huge + (double)x > 0.0) + if (huge + x > 0.0) if (u.bits.exp > 0 || (u.bits.manh | u.bits.manl) != 0) u.e = u.bits.sign ? -1.0 : 0.0; @@ -76,7 +76,7 @@ floorl(long double x) #endif INC_MANH(u, 1llu << (MANH_SIZE - e - 1)); } - if (huge + (double)x > 0.0) { /* raise inexact flag */ + if (huge + x > 0.0) { /* raise inexact flag */ u.bits.manh &= ~m; u.bits.manl = 0; } @@ -95,7 +95,7 @@ floorl(long double x) INC_MANH(u, 1); } } - if (huge + (double)x > 0.0) /* raise inexact flag */ + if (huge + x > 0.0) /* raise inexact flag */ u.bits.manl &= ~m; } return (u.e); |