Hi!
Can someone tell me how to handle
floating point exceptions in C.I am working on a linux platform.
Printable View
Hi!
Can someone tell me how to handle
floating point exceptions in C.I am working on a linux platform.
Don't generate any exceptions in the first place. :p
nice idea :D
The program is a bit on the lengthier side so
it is slightly difficult for me not to 'generate exceptions'..
Check to see if you could be dividing by zero somewhere in the program.
Write a signal handler?
http://www.linuxmanpages.com/man2/signal.2.php
ok i will try out the signal handler.
There may be a small problem, i open another
process during my program and the link here says that we need to be careful
using it in a multi threaded process.Anyways i will try it out and let you know
Whether there is only one thread, or many doesn't matter.
The code inside a signal handler is in it's own separate world, and those are the functions which are deemed to be signal safe.
I'm not sure what you want to achieve following an FP exception.