Keep It Simple, Stupid | |
PerlMonks |
Re^2: ulam's spiral too slowby dokkeldepper (Friar) |
on Apr 16, 2007 at 07:23 UTC ( [id://610277]=note: print w/replies, xml ) | Need Help?? |
considering
In general it is much faster to generate an array of ones and fill it muliplicatively with zeroes. All ones left indicate a prime. Note that multiplication is usually much faster than division and it provides a kind of build-in cache.
In Section
Seekers of Perl Wisdom
|
|