Fortran · Exception

IEEE_OVERFLOW — Floating-Point Overflow

What does IEEE_OVERFLOW — Floating-Point Overflow mean in Fortran?

Raised when a real or complex arithmetic result's magnitude exceeds the largest finite value that fits the destination kind — the correctly rounded answer would need an exponent bigger than the format allows. Left untrapped, the operation quietly produces a signed Infinity and the program keeps running with that value propagating through later computations.

IEEE_OVERFLOW — Floating-Point OverflowIntel Fortran · gfortran

Condition

Raised when a real or complex arithmetic result's magnitude exceeds the largest finite value that fits the destination kind — the correctly rounded answer would need an exponent bigger than the format allows. Left untrapped, the operation quietly produces a signed Infinity and the program keeps running with that value propagating through later computations.

Fix

Enable halting via IEEE_SET_HALTING_MODE(IEEE_OVERFLOW, .TRUE.) or -ffpe-trap=overflow to stop at the source, then either rescale the computation or move the affected variables to a wider real kind if the magnitude is legitimately that large.

Related exception