fesetexceptflag() — Set the floating-point status flags

Standards

Standards / Extensions C or C++ Dependencies
C99
Single UNIX Specification, Version 3
C++ TR1 C99
both  z/OS® V1R7

Format

#define _ISOC99_SOURCE
#include <fenv.h>

int fesetexceptflag(const fexcept_t *flagp, int excepts);

General description

fesetexceptflag() sets the floating-point status flags indicated by excepts to the states stored in the object pointed to by flagp. The value of flagp should be set by fegetexceptflag(), whose second argument represents the floating-point exceptions indicated by the argument excepts. This function does not raise floating-point exceptions, but only sets the state of the flags.
Note: The following table shows the viable formats for these functions. See IEEE binary floating-point for more information about IEEE Binary Floating-Point.
Function Hex IEEE
fesetexceptflag   X

Returned value

If successful, fesetexceptflag() returns 0 if excepts is 0 or if all selected exceptions are successfully set.

Related information