1 /* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Landon Curt Noll. 7 * 8 * %sccs.include.redist.c% 9 * 10 * @(#)primes.h 8.1 (Berkeley) 05/31/93 11 */ 12 13 /* 14 * primes - generate a table of primes between two values 15 * 16 * By: Landon Curt Noll chongo@toad.com, ...!{sun,tolsoft}!hoptoad!chongo 17 * 18 * chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\ 19 */ 20 21 /* ubig is the type that holds a large unsigned value */ 22 typedef unsigned long ubig; /* must be >=32 bit unsigned value */ 23 24 /* 25 * sieve parameters 26 */ 27 #define BIG ((ubig)0xffffffff) /* highest value we will sieve */ 28 #define SEMIBIG ((ubig)0x7fffffff) /* highest signed value */ 29 #define NEG_SEMIBIG ((ubig)0x80000000) /* lowest signed value */ 30 #define TABSIZE 256*1024 /* bytes in sieve table (must be > 3*5*7*11) */ 31