]> git.lizzy.rs Git - rust.git/commit
In sieve example, end iteration sooner
authorGraham Fawcett <graham.fawcett@gmail.com>
Thu, 9 Oct 2014 14:02:07 +0000 (10:02 -0400)
committerGraham Fawcett <graham.fawcett@gmail.com>
Thu, 9 Oct 2014 14:02:07 +0000 (10:02 -0400)
commit7cf1f55426570582224e0568c838a29c5f7db5ea
treeffe8b5d2dbea41b61b21caf4e9726a8e35b730f3
parente6cfb56a5cee28b08ae9d2dcbb2552497ce922c1
In sieve example, end iteration sooner

The Sieve algorithm only requires checking all elements up to and including the square root of the maximum prime you're looking for. After that, the remaining elements are guaranteed to be prime.
src/libcollections/bitv.rs