##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# Standard library header <cfenv>

From cppreference.com
< 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

feclearexcept (C++11) | clears the specified floating-point status flags (function) [edit]
fetestexcept (C++11) | determines which of the specified floating-point status flags are set (function) [edit]
feraiseexcept (C++11) | raises the specified floating-point exceptions (function) [edit]
fegetexceptflag fesetexceptflag (C++11)(C++11) | copies the state of the specified floating-point status flags from or to the floating-point environment (function) [edit]
fegetround fesetround (C++11)(C++11) | gets or sets rounding direction (function) [edit]
fegetenv fesetenv (C++11) | saves or restores the current floating point environment (function) [edit]
feholdexcept (C++11) | saves the environment, clears all status flags and ignores all future errors (function) [edit]
feupdateenv (C++11) | restores the floating-point environment and raises the previously raise exceptions (function) [edit]

### [edit] Macros

FE_ALL_EXCEPT FE_DIVBYZERO FE_INEXACT FE_INVALID FE_OVERFLOW FE_UNDERFLOW (C++11) | floating-point exceptions (macro constant) [edit]
FE_DOWNWARD FE_TONEAREST FE_TOWARDZERO FE_UPWARD (C++11) | floating-point rounding direction (macro constant) [edit]
FE_DFL_ENV (C++11) | default floating-point environment (macro constant) [edit]

### [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);
    }

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/header/cfenv&oldid=57440"