diff options
| -rw-r--r-- | man7/math_error.7 | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/man7/math_error.7 b/man7/math_error.7 index 8662768dfa..1f6fb519a1 100644 --- a/man7/math_error.7 +++ b/man7/math_error.7 @@ -21,7 +21,7 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.TH MATH_ERROR 7 2008-07-30 "Linux" "Linux Programmer's Manual" +.TH MATH_ERROR 7 2008-08-11 "Linux" "Linux Programmer's Manual" .SH NAME math_error \- detecting errors from mathematical functions .SH SYNOPSIS @@ -31,13 +31,14 @@ math_error \- detecting errors from mathematical functions .B #include <fenv.h> .fi .SH DESCRIPTION -On error, many of the mathematical functions declared in +When an error occurs, +most library functions indicate this fact by returning a special value +(e.g., \-1 or NULL). +Because they typically return a floating-point number, +the mathematical functions declared in .IR <math.h> -return a NaN (not a number). -However, rather than looking at the return value -(which is not always possible) -one can also check whether an error was signaled. -There are two signaling mechanisms: +indicate an error using other mechanisms. +There are two error-reporting mechanisms: the older one sets .IR errno ; the newer one uses the floating-point exception mechanism (the use of @@ -95,6 +96,8 @@ value falls outside the domain for which the function is defined (e.g., giving a negative argument to .BR log (3)). When a domain error occurs, +math functions commonly return a NaN +(though some functions return a different value in this case); .I errno is set to .BR EDOM , |
