Name

fegetenv, feholdexcept, fesetenv, feupdateenv
- C99 floating point rounding and exception handling

Library

libm.lib

Synopsis

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

Return values

The fegetenv, feholdexcept, fesetenv, and feupdateenv functions return 0 if they succeed, and non-zero otherwise.

Detailed description

The floating-point environment includes exception flags and masks, the current rounding mode, and other architecture-specific settings. However, it does not include the floating-point register file.

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.


See also

feclearexcept fegetenv

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top