diff options
author | bde <bde@FreeBSD.org> | 2008-02-22 09:21:14 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2008-02-22 09:21:14 +0000 |
commit | dc8c48731a6c74c832a2e48b77793701be241ae2 (patch) | |
tree | e0e5517d82be6ae6c295c49c5d2e35493c09c9c9 | |
parent | 2cd6e0299ae95d414ec249d8459c2f38e3c40637 (diff) | |
download | FreeBSD-src-dc8c48731a6c74c832a2e48b77793701be241ae2.zip FreeBSD-src-dc8c48731a6c74c832a2e48b77793701be241ae2.tar.gz |
Fix rintl() on signaling NaNs and unsupported formats.
-rw-r--r-- | lib/msun/src/s_rintl.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/msun/src/s_rintl.c b/lib/msun/src/s_rintl.c index 43a535a..b2a85b6 100644 --- a/lib/msun/src/s_rintl.c +++ b/lib/msun/src/s_rintl.c @@ -54,11 +54,9 @@ rintl(long double x) u.e = x; if (u.bits.exp >= BIAS + LDBL_MANT_DIG - 1) { - /* - * The biased exponent is greater than the number of digits - * in the mantissa, so x is inf, NaN, or an integer. - */ - return (x); + if (u.bits.exp == BIAS + LDBL_MAX_EXP) + return (x + x); /* Inf, NaN, or unsupported format */ + return (x); /* finite and already an integer */ } sign = u.bits.sign; |