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 manual/21400] New: Section "Infinity and NaN" of the libc manual


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

            Bug ID: 21400
           Summary: Section "Infinity and NaN" of the libc manual
           Product: glibc
           Version: 2.25
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: manual
          Assignee: unassigned at sourceware dot org
          Reporter: vincent-srcware at vinc17 dot net
                CC: mtk.manpages at gmail dot com, roland at gnu dot org
  Target Milestone: ---

https://www.gnu.org/savannah-checkouts/gnu/libc/manual/html_node/Infinity-and-NaN.html
has several issues:

1. This page contains XML/HTML entities (this issue might come conversion to
HTML).

2. "NaN, on the other hand, infects any calculation that involves it. Unless
the calculation would produce the same result no matter what real value
replaced NaN, the result is NaN."

I would replace "any calculation that involves it" by "most calculations that
involve it". The second sentence is also not valid for
fmin/fminf/fminl/fmax/fmaxf/fmaxl when the NaN is a quiet NaN. For instance,
fmin(1,qNaN) will give 1 even though fmin(1,0) would give 0.

3. math.h and fenv.h should respectively be replaced by <math.h> and <fenv.h>
(see the C standard).

4. For the macro NAN, this is no longer a GNU extension. Like INFINITY, it has
been introduced in ISO C99. So, the following parts of the text are no longer
valid: "This macro is a GNU extension" and "(Of course, you must arrange for
GNU extensions to be visible, such as by defining _GNU_SOURCE, and then you
must include math.h.)".

5. "IEEE 754 also allows for another unusual value: negative zero. This value
is produced when you divide a positive number by negative infinity, or when a
negative result is smaller than the limits of representation."

A negative zero can also simply be produced by negating an expression whose
result is a positive zero. So, it is not that unusual. This paragraph may also
not have its place in this section on infinity and NaN. Either the user knows
the existence of the negative zero and this paragraph is useless, or the user
doesn't know it and may be confused (e.g. about -0.0 == +0.0).

Note: There is currently an issue discussed in the stds-754 list about the
non-associativity of the minimum and maximum operations (fmin/fmax/... in C)
with signaling NaN's: fmin(1,fmin(1,sNaN)) → 1 but fmin(fmin(1,1),sNaN) → qNaN,
which is regarded as a mistake in the specification. So, things might change
about TS 18661-1:2014.

-- 
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]