[Solved] Why ‘IF’ made this code 2x faster as the output is the same and ‘IF’ make an extra check? [closed]
[ad_1] In words, the process you’re doing says “zero out the flags for all multiples of this number.” The if statement says “do the next step only if the current number is a prime.” The second sieve has to zero out all multiples of 2, then 3, then 4, … for every number in the … Read more