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/17661] New: printf should output "nan" for some invalid floating point values


https://sourceware.org/bugzilla/show_bug.cgi?id=17661

            Bug ID: 17661
           Summary: printf should output "nan" for some invalid floating
                    point values
           Product: glibc
           Version: 2.20
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: P at draigBrady dot com
                CC: drepper.fsp at gmail dot com

Created attachment 7976
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7976&action=edit
test case

With the attached program compiled against glibc or gnulib's vasnprintf() we
get:

  $ sdiff -t -w72 gnulib.out glibc.out
  Pseudo-Infinity                       Pseudo-Infinity
  nan                                |  -0[4911 zeros elided]0.000000
  nan                                |  -0.000000e+4912
  nan                                |  -0e+4912
  Pseudo-Zero                           Pseudo-Zero
  nan                                |  0.000000
  nan                                |  0.000000e+00
  nan                                |  0
  Unnormalized number                   Unnormalized number
  nan                                |  1.550000
  nan                                |  1.550000e+00
  nan                                |  1.55
  Pseudo-Denormal                       Pseudo-Denormal
  nan                                |  0.000000
  nan                                |  8.405258e-4934
  nan                                |  8.40526e-4934

It would be great if glibc would output "nan" also
to greacefully deal with corruption, and so that
gnulib using programs can use the glibc printf functions.

See also bug 4586

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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