Hi!
Can someone tell me how to handle
floating point exceptions in C.I am working on a linux platform.
Hi!
Can someone tell me how to handle
floating point exceptions in C.I am working on a linux platform.
nice idea
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
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
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.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.