I\'ve been trying to find a standards-compliant way to check for Infinite and NaN values in Fortran 90/95 but it proved harder than I thought.
For Inf it seems to work that if (A-1 .eq. A) is true, then A is Inf