The C99 standard header file <fenv.h> provides
access to an IEEE 754-compliant floating-point environment for numerical
programming. The library introduces two types and numerous macros
and functions for managing and controlling floating-point state.
The new types supported are:
fenv_t, representing the entire
floating-point environment
fexcept_t, representing the floating-point
state.
New macros supported include:
FE_DIVBYZERO, FE_INEXACT, FE_INVALID, FE_OVERFLOW and FE_UNDERFLOW for
managing floating-point exceptions
FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD for
managing rounding in the represented rounding direction
FE_DFL_ENV, representing the
default floating-point environment.
New functions include:
int feclearexcept(int ex); // clear floating-point exceptions selected by ex
int feraiseexcept(int ex); // raise floating point exceptions selected by ex
int fetestexcept(int ex); // test floating point exceptions selected by x
int fegetround(void); // return the current rounding mode
int fesetround(int mode); // set the current rounding mode given by mode
int fegetenv(fenv_t *penv); return the floating-point environment in penv
int fesetenv(const fenv_t *penv); // set the floating-point environment to penv
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.