+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
* lseek::
* lstat::
* malloc::
+* math_errhandling::
* mblen::
* mbrlen::
* mbrtoc8::
@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
--- /dev/null
+@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