This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/4327] New: printf does not reliably conform to C standard when printing doubles
- From: "cottrell at wfu dot edu" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 6 Apr 2007 00:43:25 -0000
- Subject: [Bug libc/4327] New: printf does not reliably conform to C standard when printing doubles
- Reply-to: sourceware-bugzilla at sourceware dot org
#include <stdio.h>
int main (void)
{
double a = 1.0;
double b = 0.9999999999999999;
printf("%#12.5g\n", a);
printf("%#12.5g\n", b);
return 0;
}
The above produces as output:
1.0000
1.00000
According to the C standard it should produce
1.0000
1.0000
--
Summary: printf does not reliably conform to C standard when
printing doubles
Product: glibc
Version: 2.4
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: cottrell at wfu dot edu
CC: glibc-bugs at sources dot redhat dot com
GCC build triplet: i686 GNU/Linux
GCC host triplet: i686 GNU/Linux
GCC target triplet: i686 GNU/Linux
http://sourceware.org/bugzilla/show_bug.cgi?id=4327
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.