On systems that support it, when called with PETSC_FP_TRAP_ON this routine causes floating point
underflow, overflow, divide-by-zero, and invalid-operand (e.g., a NaN) to
cause a message to be printed and the program to exit.
Note
On many common systems, the floating
point exception state is not preserved from the location where the trap
occurred through to the signal handler. In this case, the signal handler
will just say that an unknown floating point exception occurred and which
function it occurred in. If you run with -fp_trap in a debugger, it will
break on the line where the error occurred. On systems that support C99
floating point exception handling You can check which
exception occurred using fetestexcept(FE_ALL_EXCEPT). See fenv.h
(usually at /usr/include/bits/fenv.h) for the enum values on your system.
Caution
On certain machines, in particular the IBM PowerPC, floating point
trapping may be VERY slow!