Skip to content

When clearing non-primes in the sieve (the second operation), the algorithm clears all non-primes individually, increasing the number with 2 * factor on each cycle. #454

Answered by rbergen
schmide asked this question in Q&A
Discussion options

You must be logged in to vote

What matters for sure is that all the calculations and indexing related to clearing the prime candidate flags (whether they are booleans, bits or another data type) are performed during the "second operation" within the timed algorithm, and not based on pre-calculated bitmaps or something similar. Beyond that, as with any rule, we make up our minds about an approach when there is actual source code to look at.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by schmide
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants