summaryrefslogtreecommitdiffstats
path: root/man7/math_error.7
diff options
context:
space:
mode:
Diffstat (limited to 'man7/math_error.7')
-rw-r--r--man7/math_error.732
1 files changed, 16 insertions, 16 deletions
diff --git a/man7/math_error.7 b/man7/math_error.7
index d3b3c1a..6fdff9a 100644
--- a/man7/math_error.7
+++ b/man7/math_error.7
@@ -3,7 +3,7 @@
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
-.TH math_error 7 2023-05-03 "Linux man-pages 6.05.01"
+.TH math_error 7 2023-10-31 "Linux man-pages 6.7"
.SH NAME
math_error \- detecting errors from mathematical functions
.SH SYNOPSIS
@@ -30,33 +30,33 @@ and
as outlined below)
described in
.BR fenv (3).
-.PP
+.P
A portable program that needs to check for an error from a mathematical
function should set
.I errno
to zero, and make the following call
-.PP
+.P
.in +4n
.EX
feclearexcept(FE_ALL_EXCEPT);
.EE
.in
-.PP
+.P
before calling a mathematical function.
-.PP
+.P
Upon return from the mathematical function, if
.I errno
is nonzero, or the following call (see
.BR fenv (3))
returns nonzero
-.PP
+.P
.in +4n
.EX
fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW |
FE_UNDERFLOW);
.EE
.in
-.PP
+.P
.\" enum
.\" {
.\" FE_INVALID = 0x01,
@@ -67,7 +67,7 @@ fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW |
.\" FE_INEXACT = 0x20
.\" };
then an error occurred in the mathematical function.
-.PP
+.P
The error conditions that can occur for mathematical functions
are described below.
.SS Domain error
@@ -117,7 +117,7 @@ occurs when the magnitude of the function result means that it
cannot be represented in the result type of the function.
The return value of the function depends on whether the range error
was an overflow or an underflow.
-.PP
+.P
A floating result
.I overflows
if the result is finite,
@@ -139,7 +139,7 @@ is set to
and an "overflow"
.RB ( FE_OVERFLOW )
floating-point exception is raised.
-.PP
+.P
A floating result
.I underflows
if the result is too small to be represented in the result type.
@@ -154,7 +154,7 @@ may be set to
and an "underflow"
.RB ( FE_UNDERFLOW )
floating-point exception may be raised.
-.PP
+.P
Some functions deliver a range error if the supplied argument value,
or the correct function result, would be
.IR subnormal .
@@ -186,7 +186,7 @@ A few functions set
but don't raise an exception.
A very few functions do neither.
See the individual manual pages for details.
-.PP
+.P
To avoid the complexities of using
.I errno
and
@@ -199,7 +199,7 @@ For example, the following code ensures that
.BR log (3)'s
argument is not a NaN and is not zero (a pole error) or
less than zero (a domain error):
-.PP
+.P
.in +4n
.EX
double x, r;
@@ -211,13 +211,13 @@ if (isnan(x) || islessequal(x, 0)) {
r = log(x);
.EE
.in
-.PP
+.P
The discussion on this page does not apply to the complex
mathematical functions (i.e., those declared by
.IR <complex.h> ),
which in general are not required to return errors by C99
and POSIX.1.
-.PP
+.P
The
.BR gcc (1)
.I "\-fno\-math\-errno"
@@ -242,5 +242,5 @@ An error can still be tested for using
.BR isgreater (3),
.BR matherr (3),
.BR nan (3)
-.PP
+.P
.I "info libc"