All of the code for primes() I've seen on this thread are 2-10x slower than any of the four shown on RosettaCode for this task.
If you want the fastest speed, use the ntheory module -- is_prime for primality testing, primes or forprimes or one of the related functions for generating primes. This will be a few orders of magnitude faster.
In reply to Re^5: Number functions.. primes (ugly code runs faster)
by danaj
in thread Number functions I have lying around
by Lady_Aleena
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |