[Bug libc/4858] New: printf alternate %#g format prints wrong number of digits

wirawan0 at gmail dot com sourceware-bugzilla@sourceware.org
Fri Jul 27 18:47:00 GMT 2007


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.



More information about the Glibc-bugs mailing list