From 0007fc9bdd1d9efcd52d07837f2cd085b5a8f58b Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 23 May 2013 18:00:10 +0200 Subject: [BZ #15522] strtod ("nan(N)") returning a sNaN in some cases --- stdlib/strtof_l.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'stdlib/strtof_l.c') diff --git a/stdlib/strtof_l.c b/stdlib/strtof_l.c index 6fb44bd403..c4c1c1f2dd 100644 --- a/stdlib/strtof_l.c +++ b/stdlib/strtof_l.c @@ -37,10 +37,9 @@ extern unsigned long long int ____strtoull_l_internal (const char *, char **, #define SET_MANTISSA(flt, mant) \ do { union ieee754_float u; \ u.f = (flt); \ - if ((mant & 0x7fffff) == 0) \ - mant = 0x400000; \ - u.ieee.mantissa = (mant) & 0x7fffff; \ - (flt) = u.f; \ + u.ieee_nan.mantissa = (mant); \ + if (u.ieee.mantissa != 0) \ + (flt) = u.f; \ } while (0) #include "strtod_l.c" -- cgit v1.2.3