fixed overflow error
This commit is contained in:
parent
ec87c005af
commit
07267206a2
4 changed files with 1690364 additions and 14 deletions
778824
fortran/array.txt
Normal file
778824
fortran/array.txt
Normal file
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
|
@ -2,9 +2,9 @@ program test
|
||||||
implicit none
|
implicit none
|
||||||
1 format(1i10)
|
1 format(1i10)
|
||||||
|
|
||||||
integer (kind = 8), parameter :: base = 2, chunk = 1000000000
|
integer (kind = 16), parameter :: base = 2, chunk = 1000000000
|
||||||
double precision :: S
|
double precision :: S
|
||||||
integer (kind = 8) :: i, len
|
integer (kind = 16) :: i, len
|
||||||
|
|
||||||
open(1, file = "prev.txt")
|
open(1, file = "prev.txt")
|
||||||
write(1,1) 1
|
write(1,1) 1
|
||||||
|
|
@ -28,8 +28,8 @@ contains
|
||||||
|
|
||||||
function is_fourth_free (x)
|
function is_fourth_free (x)
|
||||||
|
|
||||||
integer (kind = 8), intent (in) :: x
|
integer (kind = 16), intent (in) :: x
|
||||||
integer (kind = 8) :: i
|
integer (kind = 16) :: i
|
||||||
logical :: is_fourth_free
|
logical :: is_fourth_free
|
||||||
|
|
||||||
i = 2
|
i = 2
|
||||||
|
|
@ -46,8 +46,8 @@ end function is_fourth_free
|
||||||
|
|
||||||
function is_square_free (x)
|
function is_square_free (x)
|
||||||
|
|
||||||
integer (kind = 8), intent (in) :: x
|
integer (kind = 16), intent (in) :: x
|
||||||
integer (kind = 8) :: i
|
integer (kind = 16) :: i
|
||||||
logical :: is_square_free
|
logical :: is_square_free
|
||||||
|
|
||||||
i = 2
|
i = 2
|
||||||
|
|
@ -64,8 +64,8 @@ end function is_square_free
|
||||||
|
|
||||||
function is_prime (x)
|
function is_prime (x)
|
||||||
|
|
||||||
integer (kind = 8), intent (in) :: x
|
integer (kind = 16), intent (in) :: x
|
||||||
integer (kind = 8) :: i
|
integer (kind = 16) :: i
|
||||||
logical :: is_prime
|
logical :: is_prime
|
||||||
|
|
||||||
if (x < 2 .or. mod(x, 2) == 0) then
|
if (x < 2 .or. mod(x, 2) == 0) then
|
||||||
|
|
@ -88,10 +88,10 @@ end function is_prime
|
||||||
function step (x)
|
function step (x)
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
integer (kind = 8), intent (in) :: x
|
integer (kind = 16), intent (in) :: x
|
||||||
integer (kind = 8) :: i, t, count
|
integer (kind = 16) :: i, t, count
|
||||||
integer (kind = 8), dimension (:), allocatable :: step
|
integer (kind = 16), dimension (:), allocatable :: step
|
||||||
integer (kind = 8), dimension (base) :: temp
|
integer (kind = 16), dimension (base) :: temp
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
|
|
||||||
|
|
@ -115,8 +115,8 @@ function next()
|
||||||
implicit none
|
implicit none
|
||||||
1 format(1i10)
|
1 format(1i10)
|
||||||
|
|
||||||
integer (kind = 8), dimension (:), allocatable :: temp, temp2
|
integer (kind = 16), dimension (:), allocatable :: temp, temp2
|
||||||
integer (kind = 8) :: current, next
|
integer (kind = 16) :: current, next
|
||||||
integer :: i, j, templen, ios
|
integer :: i, j, templen, ios
|
||||||
logical :: done
|
logical :: done
|
||||||
|
|
||||||
|
|
|
||||||
911526
fortran/prev.txt
Normal file
911526
fortran/prev.txt
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue