diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2013-05-23 18:00:10 +0200 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2013-08-29 12:22:10 +0200 |
commit | 0007fc9bdd1d9efcd52d07837f2cd085b5a8f58b (patch) | |
tree | b3c86dbee5b95c24a8413be634ae11318ceb2f8e /sysdeps/ieee754/ldbl-96 | |
parent | f1cc4c8654b6bc431273286d3562942c50975caf (diff) | |
download | glibc-0007fc9bdd1d9efcd52d07837f2cd085b5a8f58b.tar.gz |
[BZ #15522] strtod ("nan(N)") returning a sNaN in some cases
Diffstat (limited to 'sysdeps/ieee754/ldbl-96')
-rw-r--r-- | sysdeps/ieee754/ldbl-96/strtold_l.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sysdeps/ieee754/ldbl-96/strtold_l.c b/sysdeps/ieee754/ldbl-96/strtold_l.c index ded84f342b..dccf98c461 100644 --- a/sysdeps/ieee754/ldbl-96/strtold_l.c +++ b/sysdeps/ieee754/ldbl-96/strtold_l.c @@ -34,11 +34,10 @@ #define SET_MANTISSA(flt, mant) \ do { union ieee854_long_double u; \ u.d = (flt); \ - if ((mant & 0x7fffffffffffffffULL) == 0) \ - mant = 0x4000000000000000ULL; \ - u.ieee.mantissa0 = (((mant) >> 32) & 0x7fffffff) | 0x80000000; \ - u.ieee.mantissa1 = (mant) & 0xffffffff; \ - (flt) = u.d; \ + u.ieee_nan.mantissa0 = (mant) >> 32; \ + u.ieee_nan.mantissa1 = (mant); \ + if ((u.ieee.mantissa0 | u.ieee.mantissa1) != 0) \ + (flt) = u.d; \ } while (0) #include <stdlib/strtod_l.c> |