Previous: fetestexcept, Up: Fenv [Contents][Index]

### 3.11 `feupdateenv`—update current floating-point environment

Synopsis

    #include <fenv.h>
    int feupdateenv(const fenv_t *envp);

    Link with -lm.

Description
This method attempts to save the currently raised floating point exceptions in its automatic storage, install the floating point environment specified by envp, and raise the saved floating point exceptions.

The argument envp must point to a floating-point environment obtained via `fegetenv` or `feholdexcept`.

Returns
If all actions are completed successfully, then this method returns zero. Otherwise, a non-zero value is returned.

Portability
ANSI C requires `feupdateenv`.

Not all Newlib targets have a working implementation. Refer to the file `sys/fenv.h` to see the status for your target.