Standard library header <cfenv>

< cpp‎ | header

This header was originally in the C standard library as <fenv.h>.

This header is part of the floating-point environment library.


[edit] Types

fenv_t The type representing the entire floating-point environment
fexcept_t The type representing all floating-point status flags collectively

[edit] Functions

clears the specified floating-point status flags
determines which of the specified floating-point status flags are set
raises the specified floating-point exceptions
copies the state of the specified floating-point status flags from or to the floating-point environment
gets or sets rounding direction
saves or restores the current floating point environment
saves the environment, clears all status flags and ignores all future errors
restores the floating-point environment and raises the previously raise exceptions

[edit] Macros

floating-point exceptions
(macro constant)
floating-point rounding direction
(macro constant)
default floating-point environment
(macro constant)

[edit] Synopsis

namespace std {
    // types
    typedef /*object type*/ fenv_t;
    typedef /*integer type*/ fexcept_t;
    // functions
    int feclearexcept(int except);
    int fegetexceptflag(fexcept_t *pflag, int except);
    int feraiseexcept(int except);
    int fesetexceptflag(const fexcept_t *pflag, int except);
    int fetestexcept(int except);
    int fegetround(void);
    int fesetround(int mode);
    int fegetenv(fenv_t *penv);
    int feholdexcept(fenv_t *penv);
    int fesetenv(const fenv_t *penv);
    int feupdateenv(const fenv_t *penv);