Thanks. Generalizing the program to
program denormal
use ieee_arithmetic
implicit none
integer :: pow10
real :: x
write (*,"(a6,a10,3x,*(a12))") "pow10","x","is_finite","is_normal", &
"x==0.0","x<tiny","chk_normal"
do pow10 = 0,9
x = tiny(x) / (10.0**pow10)
write(*,"(4x,i1,2x,es10.4,*(l12))") pow10,x,ieee_is_finite(x), &
ieee_is_normal(x),x==0.0,x<tiny(x), (x>0.0 .and. x>=tiny(x)) .or. x == 0.0
end do
end program denormal
the output with gfortran is
pow10 x is_finite is_normal x==0.0 x<tiny chk_normal
0 1.1755E-38 T T F F T
1 1.1755E-39 T F F T F
2 1.1755E-40 T F F T F
3 1.1755E-41 T F F T F
4 1.1757E-42 T F F T F
5 1.1771E-43 T F F T F
6 1.1210E-44 T F F T F
7 1.4013E-45 T F F T F
8 0.0000E+00 T T T T T
9 0.0000E+00 T T T T T
and with Intel Fortran is
pow10 x is_finite is_normal x==0.0 x<tiny chk_normal
0 1.1755E-38 T T F F T
1 0.0000E+00 T T T T T
2 0.0000E+00 T T T T T
3 0.0000E+00 T T T T T
4 0.0000E+00 T T T T T
5 0.0000E+00 T T T T T
6 0.0000E+00 T T T T T
7 0.0000E+00 T T T T T
8 0.0000E+00 T T T T T
9 0.0000E+00 T T T T T
It appears that ieee_is_normal(x)
gives the same result as
(x>0.0 .and. x>=tiny(x)) .or. x == 0.0
for nonnegative x. For Intel Fortran when x is less than tiny(x) it is set to zero, but for gfortran there are numbers where x is less than tiny(x) but not equal to zero.