How can I handle floating-point exceptions gracefully?

Q

How can I handle floating-point exceptions gracefully?

✍: Guest

A

On many systems, you can define a function matherr which will be called when there are certain floating-point errors, such as errors in the math routines in <math.h>. You may also be able to use signal to catch SIGFPE

2015-03-04, 1172👍, 0💬