[Bug libc/3479] Incorrect rounding in strtod()

exploringbinary at gmail dot com sourceware-bugzilla@sourceware.org
Fri Jun 4 01:02:00 GMT 2010


------- Additional Comments From exploringbinary at gmail dot com  2010-06-04 01:02 -------
Regarding the example 3.518437208883201171875e+013, I think you can see what's
going on better by looking at its value in "pure" binary:

1000000000000000000000000000000000000000000000.00000011

It has 54 significant bits, with bit 54 equal to 1 -- a halfway case. Since bit
53 is also 1, it should round up to 

1000000000000000000000000000000000000000000000.000001

I've written an article describing this and other examples of incorrectly
rounded conversions:
http://www.exploringbinary.com/incorrectly-rounded-conversions-in-gcc-and-glibc/ .

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=3479

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the Glibc-bugs mailing list