]> Savannah Git Hosting - gnulib.git/commitdiff
doc: Add documentation about math_errhandling.
authorBruno Haible <bruno@clisp.org>
Fri, 19 Jul 2024 17:49:20 +0000 (19:49 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 19 Jul 2024 18:28:56 +0000 (20:28 +0200)
* doc/posix-functions/math_errhandling.texi: New file.
* doc/gnulib.texi (Function Substitutes): Include it.

ChangeLog
doc/gnulib.texi
doc/posix-functions/math_errhandling.texi [new file with mode: 0644]

index 4e88d446a1ae7b16b6e1713ff3e9f556b53b4cd8..6f3b910d5ff0594e4bb1a40e1535ec90ca867197 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-07-19  Bruno Haible  <bruno@clisp.org>
+
+       doc: Add documentation about math_errhandling.
+       * doc/posix-functions/math_errhandling.texi: New file.
+       * doc/gnulib.texi (Function Substitutes): Include it.
+
 2024-07-19  Paul Eggert  <eggert@cs.ucla.edu>
 
        xstrtol: be more robust against odd failures
index f538925d8d2703032d81480b7d640bd457bdd76b..683d2aabca240999a72867cc99e84dde9d7c2f07 100644 (file)
@@ -1907,6 +1907,7 @@ problems are not worked around by Gnulib.
 * lseek::
 * lstat::
 * malloc::
+* math_errhandling::
 * mblen::
 * mbrlen::
 * mbrtoc8::
@@ -3303,6 +3304,7 @@ problems are not worked around by Gnulib.
 @include posix-functions/lseek.texi
 @include posix-functions/lstat.texi
 @include posix-functions/malloc.texi
+@include posix-functions/math_errhandling.texi
 @include posix-functions/mblen.texi
 @include posix-functions/mbrlen.texi
 @include posix-functions/mbrtoc8.texi
diff --git a/doc/posix-functions/math_errhandling.texi b/doc/posix-functions/math_errhandling.texi
new file mode 100644 (file)
index 0000000..f897a5e
--- /dev/null
@@ -0,0 +1,34 @@
+@node math_errhandling
+@section @code{math_errhandling}
+@findex math_errhandling
+
+ISO C23 specification:@* @url{http://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf} section 7.12.1
+
+Documentation:@* @uref{https://www.kernel.org/doc/man-pages/online/pages/man7/math_error.7.html,,man math_error}
+
+Gnulib module: ---
+
+Portability problems fixed by Gnulib:
+@itemize
+@end itemize
+
+Portability problems not fixed by Gnulib:
+@itemize
+@item
+This macro is missing on some platforms:
+NetBSD 10.0, mingw.
+@item
+This macro does not describe the error behaviour
+of elementary arithmetic operations (+, -, *, /)
+and of mathematical operations for which the compiler emits inline code
+(such as @code{sqrt} on some CPUs).
+@item
+This macro does not describe the error behaviour of functions
+such as @code{strtod}.
+@item
+For mathematical operations in general, it is a safer bet to look
+at the exceptions set in the floating-point environment
+(by calling @code{feclearexcept (FE_ALL_EXCEPT)} before the operation
+and @code{fetestexcept} after the operation),
+regardless of @code{math_errhandling}.
+@end itemize