Fortran · Exception
What does IEEE_DIVIDE_BY_ZERO — Floating-Point Division by Zero mean in Fortran?
Signals when a finite nonzero floating-point value is divided by exact zero (integer division by zero is a separate, always-fatal condition, not this flag). Without trapping, the division returns a correctly signed Infinity rather than stopping the program, which can silently corrupt downstream results.
Signals when a finite nonzero floating-point value is divided by exact zero (integer division by zero is a separate, always-fatal condition, not this flag). Without trapping, the division returns a correctly signed Infinity rather than stopping the program, which can silently corrupt downstream results.
Add explicit zero-denominator checks before dividing where zero is a plausible input, or turn on trapping with -ffpe-trap=zero (gfortran) or IEEE_SET_HALTING_MODE(IEEE_DIVIDE_BY_ZERO, .TRUE.) to abort immediately at the failing statement during debugging.