This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/3479] Incorrect rounding in strtod()
- From: "exploringbinary at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 4 Jun 2010 01:02:30 -0000
- Subject: [Bug libc/3479] Incorrect rounding in strtod()
- References: <20061107172025.3479.hack@watson.ibm.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- 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.