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_DIVBYZEROThis exception occurs when a nonzero, noninfinite number is divided by zero.
FE_INEXACTThis 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_INVALIDThis 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_INVALIDwhenever an overflow or underflow exception is raised.FE_OVERFLOWThe result of an operation exceeds the range of representable values.
FE_UNDERFLOWThe 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access