public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/17661] New: printf should output "nan" for some invalid floating point values
@ 2014-11-28 13:55 P at draigBrady dot com
  2014-11-28 16:49 ` [Bug libc/17661] " joseph at codesourcery dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: P at draigBrady dot com @ 2014-11-28 13:55 UTC (permalink / raw)
  To: glibc-bugs

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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-08-24  9:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-28 13:55 [Bug libc/17661] New: printf should output "nan" for some invalid floating point values P at draigBrady dot com
2014-11-28 16:49 ` [Bug libc/17661] " joseph at codesourcery dot com
2014-11-28 17:00 ` P at draigBrady dot com
2014-11-28 17:21 ` P at draigBrady dot com
2014-11-28 17:43 ` joseph at codesourcery dot com
2014-11-28 17:59 ` [Bug libc/17661] some invalid floating point values should be considered as "nan" P at draigBrady dot com
2014-11-28 18:30 ` joseph at codesourcery dot com
2014-11-28 18:41 ` schwab@linux-m68k.org
2014-11-29 21:49 ` eblake at redhat dot com
2015-08-24  9:52 ` jsm28 at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).