知識社群登入
fortran 的 max. integer
by 高顯忠, 2010-12-08 06:49, 人氣(2331)
!dec$if(.false.)

 b, a=           11          10
Fortran Pause - Enter command<CR> or <CR> to continue.

 b, a=  -2147483648  2147483647
Fortran Pause - Enter command<CR> or <CR> to continue.


!dec$endif
! ---------------------------------------------------------

program VF0904
implicit none

integer a, b
a= 10
b= a + 1

! 11 > 10, b > a
print *, 'b, a= ', b, a
pause

do while (b .GT. a)
  a= a + 1
  b= a + 1
end do

! not of (b > a) --> b <= a, why?
print *, 'b, a= ', b, a
pause
end program VF0904