public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/28322] New: Specify parsing of nan?
@ 2021-09-09 12:21 arthur200126 at gmail dot com
  2021-09-09 13:55 ` [Bug math/28322] " arthur200126 at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: arthur200126 at gmail dot com @ 2021-09-09 12:21 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 28322
           Summary: Specify parsing of nan?
           Product: glibc
           Version: 2.35
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: arthur200126 at gmail dot com
  Target Milestone: ---

The current glibc documentation at [1] states:
  [1]:
https://www.gnu.org/software/libc/manual/html_node/Parsing-of-Floats.html

> The strings "nan" and "nan(chars…)" are converted to NaN. Again, case is
> ignored. If chars… are provided, they are used in some unspecified fashion to
> select a particular representation of NaN (there can be several).

I find this documentation odd as glibc itself appears to have one single method
for parsing the "chars..." part in nan, defined in the source files
strtod_nan_*.c. Moreover, since commit
e02cabecf0d025ec4f4ddee290bdf7aadb873bb3,[2] the format is locale-independent,
making it more conducive to documentation. 

  [2]:
https://sourceware.org/git/?p=glibc.git;a=commit;h=e02cabecf0d025ec4f4ddee290bdf7aadb873bb3

A proposed wording for the current behavior would be:

> If chars... are provided, they are parsed into a NaN payload as if the
> sequence is given to strtoull() with a base argument of 0. (Something about
> discarding stray characters here.)

I should note that there is still ambiguity in "parsed into a payload" with
regard to how. Apparently glibc has a setpayload(), but the SET_NAN_PAYLOAD
macro does not use it.

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

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

end of thread, other threads:[~2021-09-11 11:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 12:21 [Bug math/28322] New: Specify parsing of nan? arthur200126 at gmail dot com
2021-09-09 13:55 ` [Bug math/28322] " arthur200126 at gmail dot com
2021-09-09 14:02 ` arthur200126 at gmail dot com
2021-09-09 17:09 ` joseph at codesourcery dot com
2021-09-11 11:41 ` arthur200126 at gmail dot com
2021-09-11 11:57 ` arthur200126 at gmail dot com

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