Previous Page
Next Page

fesetexceptflag

Reinstates the floating-point environment's exception status flags

#include <fenv.h>
int fesetexceptflag ( const fexcept_t *flagp , int excepts  );

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( )


Previous Page
Next Page