Main index | Section 3 | Options |
#include <fenv.h>
The fegetenv() function stores the current floating-point environment in the object pointed to by envp, whereas feholdexcept() saves the current environment, then clears all exception flags and masks all floating-point exceptions.
The fesetenv() function restores a previously saved environment. The feupdateenv() function restores a saved environment as well, but it also raises any exceptions that were set in the environment it replaces.
The feholdexcept() function is often used with feupdateenv() or fesetenv() to suppress spurious exceptions that occur as a result of intermediate computations. An example in fenv(3) demonstrates how to do this.
FEGETENV (3) | May 8, 2004 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | This philosophy, in the hands of amateurs, leads to inexplicably mind-numbing botches like the existence of two programs, “head” and “tail,” which print the first part or the last part of a file, depending. Even though their operations are duals of one another, “head” and “tail” are different programs, written by different authors, and take different options! | ” |
— The Unix Haters' handbook |