diff --git a/fortran/src/include/primes.f90 b/fortran/src/include/primes.f90 index 95c9517b..835ad51f 100644 --- a/fortran/src/include/primes.f90 +++ b/fortran/src/include/primes.f90 @@ -59,8 +59,8 @@ subroutine expand_sieve(potential_n) do i = 1, new_size is_prime(i) = 2**bits_per_int - 1 end do - call clear_prime_bit(0) - call clear_prime_bit(1) + call clear_prime_bit(0_i18t) + call clear_prime_bit(1_i18t) call sieve_up_to(new_n) current_n = new_n end subroutine expand_sieve @@ -72,7 +72,7 @@ subroutine clear_prime_bit(num) i = (num / bits_per_int) + 1 b = mod(num, bits_per_int) print *, "Translating bit #", num, "to", i, b - is_prime(i) = iand(is_prime(i), ieor(-1, 2**b)) + is_prime(i) = iand(is_prime(i), ieor(-1_i18t, 2**b)) end subroutine clear_prime_bit ! Function to check if a bit is set diff --git a/fortran/src/p0007.f90 b/fortran/src/p0007.f90 index 41a8d958..abc994c0 100644 --- a/fortran/src/p0007.f90 +++ b/fortran/src/p0007.f90 @@ -8,10 +8,11 @@ ! What is the 10 001st prime number? module Problem0007 + use constants use primes implicit none contains - integer function p0007() result(answer) + integer(i18t) function p0007() result(answer) integer :: i answer = 1