This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/4327] New: printf does not reliably conform to C standard when printing doubles


#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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]