| This class provides a static table of int sized prime numbers.
For small numbers (0-511) it contains all primes. For larger
numbers it contains 32 primes each time the number of bits is
increased. I.e., there are 32 primes from 512 to 1023,
32 primes from 1024 to 2048, etc., the primes thus becoming less
dense with size. Within the interval formed by using one more
bit (say, v0 to v1), the 32 primes are formed by searching for
the first prime greater than or equal to v0 + n*(v1-v0)/32, n
belonging to {0,1,2, ..., 31}. This creates a reasonable
distribution.
author: Søren Bak version: 1.2 21-08-2003 20:21 since: 1.0 |