PROGRAM test IMPLICIT NONE INTEGER :: i REAL :: x, s, c, t c = 0.0 s = 0.0 DO i = 1, 100 x = 0.01 - c t = s + x c = (t - s) - x s = t PRINT *, s, c END DO PRINT *, s == 1.0, s STOP END PROGRAM test
PROGRAM test IMPLICIT NONE INTEGER :: i REAL :: x, s, c, t c = 0.0 s = 0.0 DO i = 1, 100 x = 0.01 - c t = s + x c = (t - s) - x s = t PRINT *, s, c END DO PRINT *, s == 1.0, s STOP END PROGRAM test