summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2011-10-21 14:23:59 +0000
committerdas <das@FreeBSD.org>2011-10-21 14:23:59 +0000
commit05ac5f7cb8b0ddb60cf5a3ccb97dcd113c394ca7 (patch)
treef2c721e4852304823aa1750d1fc5d9fc93bb4211 /lib
parent209c4b6ab97b748552d07e131a2eef7f7526c702 (diff)
downloadFreeBSD-src-05ac5f7cb8b0ddb60cf5a3ccb97dcd113c394ca7.zip
FreeBSD-src-05ac5f7cb8b0ddb60cf5a3ccb97dcd113c394ca7.tar.gz
Minor corrections and clarifications regarding exceptions.
Diffstat (limited to 'lib')
-rw-r--r--lib/msun/man/fenv.335
1 files changed, 23 insertions, 12 deletions
diff --git a/lib/msun/man/fenv.3 b/lib/msun/man/fenv.3
index aaea5f5..6fee216 100644
--- a/lib/msun/man/fenv.3
+++ b/lib/msun/man/fenv.3
@@ -91,24 +91,35 @@ The following macros expand to bit flags of type
representing the five standard floating-point exceptions.
.Bl -tag -width ".Dv FE_DIVBYZERO"
.It Dv FE_DIVBYZERO
-A divide-by-zero exception occurs when the program attempts to
-divide a finite non-zero number by zero.
+A divide-by-zero exception occurs when the
+.Em exact
+result of a computation is infinite (according to the limit definition).
+For example, dividing a finite non-zero number by zero or computing
+.Fn log 0
+raises a divide-by-zero exception.
.It Dv FE_INEXACT
-An inexact exception is raised whenever there is a loss of precision
+An inexact exception is raised whenever there is a loss of accuracy
due to rounding.
.It Dv FE_INVALID
Invalid operation exceptions occur when a program attempts to
perform calculations for which there is no reasonable representable
answer.
-For instance, subtraction of infinities, division of zero by zero,
-ordered comparison involving \*(Nas, and taking the square root of a
+For instance, subtraction of like-signed infinities, division of zero by zero,
+ordered comparison involving \*(Nas, and taking the real square root of a
negative number are all invalid operations.
.It Dv FE_OVERFLOW
-An overflow exception occurs when the magnitude of the result of a
-computation is too large to fit in the destination type.
+In contrast with divide-by-zero,
+an overflow exception occurs when an infinity is produced because
+the magnitude of the exact result is
+.Em finite
+but too large to fit in the destination type.
+For example, computing
+.Li DBL_MAX * 2
+raises an overflow exception.
.It Dv FE_UNDERFLOW
-Underflow occurs when the result of a computation is too close to zero
-to be represented as a non-zero value in the destination type.
+Underflow occurs when the result of a computation loses precision
+because it is too close to zero.
+The result is a subnormal number or zero.
.El
.Pp
Additionally, the
@@ -183,9 +194,9 @@ as usual, but no
.Dv SIGFPE
signals will be generated as a result.
Non-stop mode is the default, but it may be altered by
-non-standard mechanisms.
-.\" XXX Mention fe[gs]etmask() here after the interface is finalized
-.\" XXX and ready to be officially documented.
+.Fn feenableexcept
+and
+.Fn fedisableexcept .
The
.Fn feupdateenv
function restores a saved environment similarly to
OpenPOWER on IntegriCloud