Skip to content

Commit

Permalink
Attempt p76 in fortran (7)
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Oct 3, 2024
1 parent dcf9ef6 commit 0f615df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions fortran/src/include/primes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ subroutine expand_sieve(potential_n)
deallocate(prime_sieve)
end if
allocate(prime_sieve(new_size))
do i = 1, new_size
prime_sieve(i) = -1
end do
prime_sieve = -1
call clear_prime_bit(0_i18t)
call clear_prime_bit(1_i18t)
call sieve_up_to(new_n)
Expand Down
3 changes: 3 additions & 0 deletions fortran/src/include/ranges.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ integer function range_entry4(start, stop, step, idx) result(answer)
length = 1 + (stop - 1 - start) / step
elseif (step < 0 .and. start > stop) then
length = 1 + (start - 1 - stop) / (-step)
else
answer = huge(kind(answer)) ! error
return
end if

if (l_idx < 0) then
Expand Down

0 comments on commit 0f615df

Please sign in to comment.