This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/14049] New: Incorrect strtod, atof etc. hex float rounding
- From: "jsm28 at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Wed, 02 May 2012 15:47:57 +0000
- Subject: [Bug libc/14049] New: Incorrect strtod, atof etc. hex float rounding
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=14049
Bug #: 14049
Summary: Incorrect strtod, atof etc. hex float rounding
Product: glibc
Version: 2.15
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: unassigned@sourceware.org
ReportedBy: jsm28@gcc.gnu.org
CC: drepper.fsp@gmail.com
Classification: Unclassified
strtod, atof and related functions always treat hex floats half way between two
representable values as rounding away from zero, instead of round-to-even.
Testcase:
#include <stdlib.h>
#include <stdio.h>
int
main (void)
{
printf ("%.16A %.16A\n", 0x10000000000000800p0, atof
("0x10000000000000800p0"));
return 0;
}
Prints:
0X1.0000000000000000P+64 0X1.0000000000001000P+64
This is different from bug 3479, which concerns strtod rounding for decimal
numbers.
I'm testing a patch.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.