Commit Graph

12 Commits (c0c54d891933ee593f2580c3d602a77da13aefe1)

Author SHA1 Message Date
John Benediktsson 34160212d1 math.primes.erato: fix reference to "arr". 2014-12-04 11:52:56 -08:00
John Benediktsson d5b8f3d3b9 math.primes.erato: fix help-lint. 2014-12-04 11:48:12 -08:00
John Benediktsson ad71f79be3 math.primes: speedup sieve. 2014-12-04 10:11:32 -08:00
John Benediktsson eaa19eb36f math.primes.erato: minor performance improvements. 2012-10-23 10:49:45 -07:00
John Benediktsson dd2a5729a7 math.primes.erato: bit faster by inlining. 2012-08-23 09:35:09 -07:00
Jon Harper f60f13c675 math.primes.erato doc fixes. 2010-11-02 17:34:28 +01:00
Rupert Swarbrick cd28c7a219 math.primes.erato: Fix off-by-one error
The sieve bit vector deals with numbers in chunks of 30. Therefore,
the number 90 (say) is the 91st 'element' of the vector. Each byte
deals with some range {0,1,...,29}+30n so to have the number 90, you
need four bytes.

Rather pleasingly, I bumped into this bug and it reduced to the
incantation:
  2010 2010 sieve marked-prime?
2010-11-02 17:34:24 +01:00
Slava Pestov ee1520f683 math.primes.erato: fix typo in docs 2010-10-22 18:26:08 -07:00
Doug Coleman 1d12a6707d sigma -> map-sum 2009-10-29 14:34:04 -05:00
Doug Coleman 4a3d63e00a use if-zero in a few more places 2009-08-11 18:15:53 -05:00
Samuel Tardieu 41d804ddbd Pack primes numbers by slices of 30
In any given 30 successive integers greater than 5, there are at most
8 prime numbers. Use this to tightly pack the result of the Eratostene
sieve. This lets us store more prime numbers than before in less space.
2009-06-24 13:15:12 +02:00
Samuel Tardieu 594bd3aee8 Move math.primes from extra to basis 2009-01-07 21:12:48 +01:00