3.3.6 Functions for saving and restoring the whole floating-point environment

The fegetenv and fesetenv functions let you save and restore the entire floating-point environment.


The following functionality requires you to select a floating-point model that supports exceptions, such as --fpmode=ieee_full or --fpmode=ieee_fixed.

C99 defines these functions as follows:

void fegetenv(fenv_t *envp);

void fesetenv(const fenv_t *envp);

The fegetenv() function stores the current state of the floating-point environment into the fenv_t variable provided. The fesetenv() function restores the environment from the variable provided.

Like fesetexceptflag(), fesetenv() does not call trap handlers when it sets the sticky flags for trapped exceptions.

Non-ConfidentialPDF file icon PDF versionARM DUI0475M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.