In a byte, it is possible to store primality information about 30
positive numbers, since modulo rules guarantee that in every 30-numbers
slice (30n .. 30n+29) only the numbers equal to 1, 7, 11, 13, 17, 19,
23 or 29 modulo 30 can be prime (except 2, 3 and 5).
This allows us to store more prime numbers using less space with a
constant access time.
I've also added tests for some words which didn't have them.
The following changes since commit 3cd3d29d72120fda8b4bba1db1d85c466f4b6ac9:
Slava Pestov (1):
Merge branch 'master' of git://factorcode.org/git/factor
are available in the git repository at:
git://git.rfc1149.net/factor.git for-slava
Samuel Tardieu (2):
Pack primes numbers by slices of 30
Add extra tests for math.primes
basis/math/primes/erato/erato-docs.factor | 10 ++----
basis/math/primes/erato/erato-tests.factor | 11 +++++-
basis/math/primes/erato/erato.factor | 46 +++++++++++++++++++---------
basis/math/primes/primes-tests.factor | 12 ++++++-
basis/math/primes/primes.factor | 18 +++++-----
5 files changed, 63 insertions(+), 34 deletions(-)
------------------------------------------------------------------------------
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk