3.2.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 a floating-point model that supports exceptions. In ARM® Compiler 6 this is disabled by default, and can be enabled by the armclang command-line option -ffp-mode=full.

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 100073_0608_00_en
Copyright © 2014–2017 ARM Limited or its affiliates. All rights reserved.