This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/4858] New: printf alternate %#g format prints wrong number of digits
- From: "wirawan0 at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 27 Jul 2007 18:47:33 -0000
- Subject: [Bug libc/4858] New: printf alternate %#g format prints wrong number of digits
- Reply-to: sourceware-bugzilla at sourceware dot org
Please use the following testcase:
#include <stdio.h>
int main(int argc, char *argv[], char *env[])
{
printf("%#.4g\n", 912.98);
return 0;
}
This code should print "913.0", but instead it only prints "913." . It lacks the
trailing zeros, which should be there according to the standard C specs.
I believe that this bug is reproducible on the stock version of glibc 2.6 . I
have established the bug by building the 2.6 library on my local machine, then
linking the program above against the newly built libc.a .
--
Summary: printf alternate %#g format prints wrong number of
digits
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P1
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: wirawan0 at gmail dot com
CC: glibc-bugs at sources dot redhat dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://sourceware.org/bugzilla/show_bug.cgi?id=4858
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.