in reply to Re^4: Number functions.. primes (ugly code runs faster)
in thread Number functions I have lying around
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Number functions.. primes (ugly code runs faster)
by Anonymous Monk on May 02, 2015 at 17:20 UTC | |
by danaj (Friar) on May 07, 2015 at 23:54 UTC | |
by Anonymous Monk on May 08, 2015 at 01:20 UTC | |
by danaj (Friar) on May 08, 2015 at 03:33 UTC |