Last active
March 6, 2018 10:46
-
-
Save kimwalisch/57e0440fb568dfe4be3865f26f566f7d to your computer and use it in GitHub Desktop.
Outer sieving loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (int64_t low = 0; low <= limit; low += segment_size) | |
{ | |
std::fill(sieve.begin(), sieve.end(), true); | |
// current segment = [low, high] | |
int64_t high = low + segment_size - 1; | |
high = std::min(high, limit); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment