aboutsummaryrefslogtreecommitdiff
path: root/stdlib/strtod_l.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2013-05-23 18:00:10 +0200
committerThomas Schwinge <thomas@codesourcery.com>2013-08-29 12:22:10 +0200
commit0007fc9bdd1d9efcd52d07837f2cd085b5a8f58b (patch)
treeb3c86dbee5b95c24a8413be634ae11318ceb2f8e /stdlib/strtod_l.c
parentf1cc4c8654b6bc431273286d3562942c50975caf (diff)
downloadglibc-0007fc9bdd1d9efcd52d07837f2cd085b5a8f58b.zip
glibc-0007fc9bdd1d9efcd52d07837f2cd085b5a8f58b.tar.gz
glibc-0007fc9bdd1d9efcd52d07837f2cd085b5a8f58b.tar.bz2
[BZ #15522] strtod ("nan(N)") returning a sNaN in some cases
Diffstat (limited to 'stdlib/strtod_l.c')
-rw-r--r--stdlib/strtod_l.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
index 5b41e2b..8f60653 100644
--- a/stdlib/strtod_l.c
+++ b/stdlib/strtod_l.c
@@ -42,11 +42,10 @@ extern unsigned long long int ____strtoull_l_internal (const char *, char **,
# define SET_MANTISSA(flt, mant) \
do { union ieee754_double u; \
u.d = (flt); \
- if ((mant & 0xfffffffffffffULL) == 0) \
- mant = 0x8000000000000ULL; \
- u.ieee.mantissa0 = ((mant) >> 32) & 0xfffff; \
- 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)
#endif
/* End of configuration part. */