Skip to content

Commit

Permalink
Logic error fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
tfpf committed Apr 30, 2024
1 parent 39dc4f5 commit b91a96d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/objects/sieve_of_atkin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl SieveOfAtkin {
let mut num: usize = 1;
let mut offset = SieveOfAtkin::OFFSETS.iter().cycle();
'sieve: for sieve_idx in 0..self.sieve.len() {
self.sieve[sieve_idx] ^= sieve2[sieve_idx] ^ sieve3[sieve_idx];
self.sieve[sieve_idx] |= sieve2[sieve_idx] | sieve3[sieve_idx];
for shift in 0..16 {
if self.sieve[sieve_idx] >> shift & 1 == 1 {
let num_sqr = num.pow(2);
Expand Down

0 comments on commit b91a96d

Please sign in to comment.