summaryrefslogtreecommitdiffstats
path: root/games/primes/primes.h
diff options
context:
space:
mode:
Diffstat (limited to 'games/primes/primes.h')
-rw-r--r--games/primes/primes.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/games/primes/primes.h b/games/primes/primes.h
index 611c86d..f4a90fa 100644
--- a/games/primes/primes.h
+++ b/games/primes/primes.h
@@ -34,6 +34,7 @@
* SUCH DAMAGE.
*
* @(#)primes.h 8.2 (Berkeley) 3/1/94
+ * $FreeBSD$
*/
/*
@@ -50,3 +51,20 @@ typedef unsigned long ubig; /* must be >=32 bit unsigned value */
/* bytes in sieve table (must be > 3*5*7*11) */
#define TABSIZE 256*1024
+
+/*
+ * prime[i] is the (i-1)th prime.
+ *
+ * We are able to sieve 2^32-1 because this byte table yields all primes
+ * up to 65537 and 65537^2 > 2^32-1.
+ */
+extern const ubig prime[];
+extern const ubig *const pr_limit; /* largest prime in the prime array */
+
+/*
+ * To avoid excessive sieves for small factors, we use the table below to
+ * setup our sieve blocks. Each element represents a odd number starting
+ * with 1. All non-zero elements are factors of 3, 5, 7, 11 and 13.
+ */
+extern const char pattern[];
+extern const size_t pattern_size; /* length of pattern array */
OpenPOWER on IntegriCloud