feupdateenv


feupdateenv

Sets the floating-point environment to a previously saved state, but preserves exceptions

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

The feupdateenv( ) function internally saves the current floating-point exception status flags before installing the floating-point environment stored in the object referenced by its pointer argument. Then the function raises floating-point exceptions that were set in the saved status flags.

The argument must be a pointer to an object obtained by a prior call to fegetenv( ) or feholdexcept( ), or a macro such as FE_DFL_ENV, which is defined as a pointer to an object of type fenv_t representing the default floating-point environment.

The function returns 0 if successful; a nonzero return value indicates that an error occurred.

Example

See the example for feholdexcept( ) in this chapter.

See Also

fegetexceptflag( ), feraisexcept( ), feclearexcept( ), fetestexcept( ), fegetenv( ), feholdexcept( ), fesetenv( ), feupdateenv( )



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net