[fix] prime sieve was missing the number 2
This commit is contained in:
parent
4c56ab2779
commit
2f6449a25a
@ -7,6 +7,7 @@ pub fn get_primes(max_nr: usize) -> Vec<u64> {
|
|||||||
sieve[1] = false;
|
sieve[1] = false;
|
||||||
|
|
||||||
let mut nr = 2;
|
let mut nr = 2;
|
||||||
|
primes.push(2);
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
check_off_multiples_of_nr(nr, &mut sieve);
|
check_off_multiples_of_nr(nr, &mut sieve);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user