fegetexceptflag

Visual Studio 2015
 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at fegetexceptflag2.

Stores the current state of the specified floating-point exception flags.

int fegetexceptflag(   
   fexcept_t* pstatus,   
   int excepts   
);  
  

Parameters

pstatus
A pointer to a fexcept_t object to contain the current values of the exception flags specified by excepts.

excepts
The floating-point exception flags to store in pstatus.

On success, returns 0. Otherwise, returns a non-zero value.

The fegetexceptflag function stores the current state of the floating-point exception status flags specified by excepts in the fexcept_t object pointed to by pstatus. pstatus must point to a valid fexcept_t object, or subsequent behavior is undefined. The fegetexceptflag function supports these exception macros, defined in <fenv.h>:

Exception MacroDescription
FE_DIVBYZEROA singularity or pole error occurred in an earlier floating-point operation; an infinity value was created.
FE_INEXACTThe function was forced to round the stored result of an earlier floating-point operation.
FE_INVALIDA domain error occurred in an earlier floating-point operation.
FE_OVERFLOWA range error occurred; an earlier floating-point operation result was too large to be represented.
FE_UNDERFLOWAn earlier floating-point operation result was too small to be represented at full precision; a denormal value was created.
FE_ALLEXCEPTThe bitwise OR of all supported floating-point exceptions.

The excepts argument may be zero, one of the supported floating-point exception macros, or the bitwise OR of two or more of the macros. The effect of any other argument value is undefined.

To use this function, you must turn off floating-point optimizations that could prevent access by using the #pragma fenv_access(on) directive prior to the call. For more information, see fenv_access.

FunctionC headerC++ header
fegetexceptflag<fenv.h><cfenv>

For additional compatibility information, see Compatibility.

Alphabetical Function Reference
fesetexceptflag

Show: