feclearexcept


feclearexcept

Clears status flags in the floating-point environment

 #include <fenv.h> int feclearexcept ( int excepts  ); 

The feclearexcept( ) function clears the floating-point exceptions specified by its argument. The value of the argument is the bitwise OR of one or more of the integer constant macros described under feraiseexcept( ) in this chapter.

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

Example

 double x, y, result; int exceptions; #pragma STDC FENV_ACCESS ON feclearexcept( FE_ALL_EXCEPT ); result = somefunction( x, y );    // This function may raise exceptions! exceptions = fetestexcept( FE_INEXACT | FE_UNDERFLOW ); if ( exceptions & FE_UNDERFLOW ) {   /* ... handle the underflow ... */ } else if ( exceptions & FE_INEXACT ) {   /* ... handle the inexact result ... */ } 

See Also

feraisexcept( ), feholdexcept( ), fetestexcept( )



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