The following program, compiled with FTN95 v. 9.03.0.0 Win32, raises an exception (Invalid floating point operation) at runtime for i=19. This error doesn't occur if KIND=2 is used for the real variables or F7.3 instead of F7.2 in the 9000 FORMAT. Am I missing an obvious pitfall in this case?
PROGRAM RUNGE
IMPLICIT NONE
INTEGER :: I, N
REAL(KIND=3) :: A, B, T
A=0.0
B=5.0
N=1000
DO I=1,N
T=(B-A)*FLOAT(I)/FLOAT(N)
WRITE(*,9000) I,T
END DO
9000 FORMAT(1X,I4,3X,F7.2)
END PROGRAM RUNGE