- #1
GabDX
- 11
- 0
I'm trying to work with big integers but for some reason this program won't compile:
The file name is prob003.f90 and I'm trying to compile with gfortran without any option:
I keep getting this error:
It does compile if I remove 3 digits from that number however. What am I doing wrong?
Code:
program prob003
implicit none
integer, parameter :: k32 = selected_int_kind(32)
integer(kind=k32) :: num = 600851475143
end program prob003
The file name is prob003.f90 and I'm trying to compile with gfortran without any option:
Code:
gfortran prob003.f90
I keep getting this error:
Code:
prob003.f90:3.42:
integer(kind=k32) :: num = 600851475143
1
Error: Integer too big for its kind at (1). This check can be disabled with the option -fno-range-check
It does compile if I remove 3 digits from that number however. What am I doing wrong?