Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #50382 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2013-07-11 03:14 +1000 |
| Last post | 2013-07-11 03:14 +1000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Prime number generator Chris Angelico <rosuav@gmail.com> - 2013-07-11 03:14 +1000
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-07-11 03:14 +1000 |
| Subject | Re: Prime number generator |
| Message-ID | <mailman.4540.1373476473.3114.python-list@python.org> |
On Thu, Jul 11, 2013 at 2:54 AM, Ian Kelly <ian.g.kelly@gmail.com> wrote: > As promised. Apologies for the excessive commenting. As noted, this > implementation is a recursive generator, which is done so that the > primes in the sieve can go only up to the square root of the current > prime, rather than tossing in every prime seen so far. > Nice. Comes in at 0.23369310904039478 in my oh-so-scientific benchmarking, so it's comparable to several of Steven's algorithms. Runs on Python 3.3 with just the tiny tweak of converting iter.next() to next(iter). ChrisA
Back to top | Article view | comp.lang.python
csiph-web