Name
feraiseexcept
Synopsis
Raises floating-point exceptions
#include <fenv.h> intferaiseexcept
( intexcepts
);
The feraiseexcept()
function raises the floating-point exceptions represented by its
argument. Unlike the fesetexceptflag()
function, feraiseexcept()
invokes any traps that
have been enabled for the given exceptions.
The argument is a bitwise OR of the values of the following macros, defined in fenv.h to represent the floating-point exception flags:
FE_DIVBYZERO
This exception occurs when a nonzero, noninfinite number is divided by zero.
FE_INEXACT
This exception indicates that true result of an operation cannot be represented with the available precision, and has been rounded in the current rounding direction.
FE_INVALID
This exception flag is set when the program attempts an operation which has no defined result, such as dividing zero by zero or subtracting infinity from infinity. Some systems may also set
FE_INVALID
whenever an overflow or underflow exception is raised.FE_OVERFLOW
The result of an operation exceeds the range of representable values.
FE_UNDERFLOW
The result of an operation is nonzero, but too small in magnitude to be represented.
Each of these macros is defined if and only if the system
supports the corresponding floating-point exception. Furthermore,
the macro FE_ALL_EXCEPT
is the
bitwise OR of all of the macros that are supported.
If feraiseexcept()
raises
the FE_INEXACT
exception in
conjunction with FE_UNDERFLOW
or
FE_OVERFLOW
, then the underflow or overflow exception ...
Get C in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.