feclearexcept() clears the supported floating-point exceptions represented by excepts.
int feclearexcept(int excepts); excepts : Bitmask listing of exception flags to clear
The feclearexcept() function returns zero value if all the exceptions were cleared or if excepts is equal to zero.
It returns nonzero if any error occurs.
For the function to work, you should enable FENV_ACCESS, which will give your program to access the Floating point environment to test the exceptions raised.
sqrt(-1) raises FE_INVALID
How feclearexcept() works?
7/0 = inf FE_DIVBYZERO is set sqrt(-5) = -nan FE_INVALID is set
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Passing Reference to a Pointer in C++
- Nested list in C++ STL
- wcrtomb() function in C/C++
- vswprintf() function in C/C++
- wcstoul() function in C/C++
- wmemchr() function in C/C++
- wmemcmp() function in C/C++
- wcstod() function in C/C++
- wcscspn() function in C/C++
- wcsncmp() function in C/C++