News for hackers. Stuff that matters.
Re:Computing primes with CSS by bonzini on Friday September 30, 2016 @06:45AM (#12611650)
FWIW, this[1] is closer to how a "real" sieve of Eratosthenes program might look like, with three optimizations: 1) omitting even numbers from the sieve, 2) sieving starting at n^2, 3) precomputing primes up to sqrt(n) if you want to sieve up to n. The code size then is Θ(sqrt(pi(n)).

[1] https://jsfiddle.net/L8mxuag5/1/

There are no comments on this comment yet.