From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9D1EA3857403; Thu, 9 Sep 2021 12:21:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D1EA3857403 From: "arthur200126 at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug math/28322] New: Specify parsing of nan? Date: Thu, 09 Sep 2021 12:21:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: math X-Bugzilla-Version: 2.35 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: arthur200126 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 12:21:19 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28322 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=E2=80=A6)" are converted to NaN. Again, = case is > ignored. If chars=E2=80=A6 are provided, they are used in some unspecifie= d 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 me= thod for parsing the "chars..." part in nan, defined in the source files strtod_nan_*.c. Moreover, since commit e02cabecf0d025ec4f4ddee290bdf7aadb873bb3,[2] the format is locale-independe= nt, making it more conducive to documentation.=20 [2]: https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3De02cabecf0d025ec4f= 4ddee290bdf7aadb873bb3 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 abo= ut > 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. --=20 You are receiving this mail because: You are on the CC list for the bug.=