Clears the supported floating-point exceptions represented by its argument.
Include
<fenv.h>
Prototype
void feclearexcept(int excepts);
Argument
excepts |
Example
See the notes at the beginning of this chapter or section for
information on using printf()
or scanf()
(and other functions reading and writing the stdin
or
stdout
streams) in the example code.
#include <fenv.h>
#include <stdio.h>
#include <math.h>
volatile double result;
int main(void)
{
feclearexcept(FE_ALL_EXCEPT); // clear all exceptions
result = sqrt(-1); // possibly generate an exeception
if(fetestexcept(FE_INVALID)) // was an exception raised?
printf("FE_INVALID exception raised by sqrt() function\n");
}
Example Output
FE_INVALID exception raised by sqrt() function