Important: The information in this document is obsolete and should not be used for new development.
fegetenv
You can use thefegetenv
function to save the current state of the floating-point environment.
void fegetenv (fenv_t *envp);
envp
- A pointer to an environment word that will store the current state of the environment upon the function's return.
DESCRIPTION
Thefegetenv
function saves the current state of the rounding direction modes and the floating-point exception flags in the object pointed to by itsenvp
argument.EXAMPLES
double_t func (double_t x, double_t y) { fenv_t *env; x = x + y; /* floating-point op; may raise exceptions */ fegetenv(env); /* save state of env after add */ y = y * x; /* floating-point op; may raise exceptions */ . . . }