Floating Point Exception Handler to Change Result

Floating Point Exception Handler to Change Result

We have some very old code here where we utilized functions that caused floating point divide by zero and other floating point exceptions to return a result of zero. I know we should check the inputs for the arguments to functions and divisions but I was interested in knowing if it was possible to write a floating point exception handler that would trap the exceptions and return the result as zero instead of NaN or Inf.

Thanks

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.