1/inf =? ifort says NaN

Optimizing compilers orften have default behaviors that favor performance over edge-cases, such as full IEEE semantics. The Fortran standard is completely silent on this topic. In the case of ifort, you need the strict option if you will be using anything from IEEE_EXCEPTIONS and possibly even IEEE_ARITHMETIC.

How realistic is it to expect a real-world application to be doing 1/Inf?

For another example, see Strange behavior of ifort - Fortran Discourse (fortran-lang.discourse.group)

2 Likes