]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Document sNaN argument error handling.
authorJoseph Myers <joseph@codesourcery.com>
Fri, 16 Dec 2016 23:41:00 +0000 (23:41 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 16 Dec 2016 23:41:00 +0000 (23:41 +0000)
TS 18661-1 says that "Whether a signaling NaN input causes a domain
error is implementation-defined.".  Considering it a domain error
would (given glibc's math_errhandling definition) mean setting errno
to EDOM.  glibc consistently does not set errno for sNaN inputs
(unless it does so for qNaN as well, i.e. iseqsig), so this patch adds
documentation of the implementation-defined choice not to treat this
case as a domain error.

* manual/arith.texi (Math Error Reporting): Document that sNaN
arguments are not considered domain errors.

ChangeLog
manual/arith.texi

index 1d93077dcde54e7ede82ad4b5e07a7306717c23c..51867920fc7016fe5375d23ad09af7fdaf8eb46d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-16  Joseph Myers  <joseph@codesourcery.com>
+
+       * manual/arith.texi (Math Error Reporting): Document that sNaN
+       arguments are not considered domain errors.
+
 2016-12-16  Zack Weinberg <zackw@panix.com>
            Florian Weimer <fweimer@redhat.com>
            Nick Mathewson <nickm@torproject.org>
index 41ab577237b262f6a7f667d5848f55116cd8e5cd..a20a4dec6c55158242e36ebb9a7a5e1da1939652 100644 (file)
@@ -939,6 +939,11 @@ guaranteed; it is intended that @theglibc{} should set it when the
 underflow is to an appropriately signed zero, but not necessarily for
 other underflows.
 
+When a math function has an argument that is a signaling NaN,
+@theglibc{} does not consider this a domain error, so @code{errno} is
+unchanged, but the invalid exception is still raised (except for a few
+functions that are specified to handle signaling NaNs differently).
+
 Some of the math functions are defined mathematically to result in a
 complex value over parts of their domains.  The most familiar example of
 this is taking the square root of a negative number.  The complex math