Name
fesetexceptflag
Synopsis
Reinstates the floating-point environment’s exception status flags
#include <fenv.h> intfesetexceptflag
( const fexcept_t *flagp
, intexcepts
);
The fesetexceptflag()
function resets the exception status flags in the floating-point
environment to a state that was saved by a prior call to fegetexceptflag()
. The object type that
represents the floating-point status flags, fexcept_t
, is defined in fenv.h.
The second argument is a bitwise OR of the values of macros
defined in fenv.h to represent
the floating-point exception flags. The macros are listed under
feraiseexcept()
in this chapter.
fesetexceptflag()
sets those
flags that correspond to the values that are set in this
mask.
All of the flags specified in the mask argument must be
represented in the status flags object passed to fesetexceptflag()
as the first argument.
Thus in the fegetexceptflag()
call used to save the flags, the second argument must have specified
at least all of the flags to be set by the call to fesetexceptflag()
.
The function returns 0 if successful (or if the value of the integer argument was zero). A nonzero return value indicates that an error occurred.
Example
See the example for fegetexceptflag()
in
this chapter.
See Also
fegetexceptflag()
,
feraisexcept()
, feclearexcept()
,
fetestexcept()
,
fegetenv()
, feholdexcept()
,
fesetenv()
, feupdateenv()
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.