The feholdexcept() function in C/C++ first saves the current floating-point environment in the object of fenv_t and it then resets the current values of all the floating point status flags. The feholdexcept() function is defined in cfenv header file in C++ and in fenv.h header file in C.
int feholdexcept( fenv_t* envp )
Parameters: The function accepts a single mandatory parameter envp which is a pointer to an object
of type fenv_t that stores the current status of the floating point environment.
Return Value: The function returns a int value on two conditions:
- If function completed succesfully it returns 0.
- On failure, it returns a nonzero integer.
Below programs illustrate the above function.
x/y = inf No exceptions raised
Exceptions raised are : FE_DIVBYZERO Exceptions raised are : No exception found Exceptions raised are : FE_DIVBYZERO
- Find the node whose sum with X has minimum set bits
- Salt and Pepper Noise removal using C++
- AKTU (UPTU) Previous Year Solved Papers | C Programming
- C++ Stream Classes Structure
- OpenMP | Hello World program
- Odd Even Transposition Sort / Brick Sort using pthreads
- Chat application between two processes using signals and shared memory
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- getdate() and setdate() function in C with Examples
- Intel Graphics Software Engineer Interview Experience
- OpenMP | Introduction with Installation Guide
- Equation of straight line passing through a given point which bisects it into two equal line segments
- Maximum absolute difference in an array
- Count the pairs of vowels in the given string
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.