Fortran · Exception

IEEE_INEXACT — Floating-Point Result Rounded

What does IEEE_INEXACT — Floating-Point Result Rounded mean in Fortran?

Signals whenever a floating-point result had to be rounded because it can't be represented exactly in the destination kind — true of the overwhelming majority of real arithmetic, including simple decimal literals like 0.1. It's included in IEEE_ALL but deliberately left out of IEEE_USUAL precisely because it fires on nearly every floating-point statement in a normal program.

IEEE_INEXACT — Floating-Point Result RoundedIntel Fortran · gfortran

Condition

Signals whenever a floating-point result had to be rounded because it can't be represented exactly in the destination kind — true of the overwhelming majority of real arithmetic, including simple decimal literals like 0.1. It's included in IEEE_ALL but deliberately left out of IEEE_USUAL precisely because it fires on nearly every floating-point statement in a normal program.

Fix

Don't enable trapping on this flag in production code — it will abort on essentially any real computation. Reserve it for narrow research into rounding behavior, and always gate its use behind an IEEE_SUPPORT_FLAG(IEEE_INEXACT, x) check first.

Related exception