primes.h (272166) | primes.h (272207) |
---|---|
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 * Redistribution and use in source and binary forms, with or without --- 16 unchanged lines hidden (view full) --- 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * @(#)primes.h 8.2 (Berkeley) 3/1/94 | 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 * Redistribution and use in source and binary forms, with or without --- 16 unchanged lines hidden (view full) --- 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * @(#)primes.h 8.2 (Berkeley) 3/1/94 |
33 * $FreeBSD: head/games/primes/primes.h 272166 2014-09-26 09:40:48Z cperciva $ | 33 * $FreeBSD: head/games/primes/primes.h 272207 2014-09-27 09:00:38Z cperciva $ |
34 */ 35 36/* 37 * primes - generate a table of primes between two values 38 * 39 * By: Landon Curt Noll chongo@toad.com, ...!{sun,tolsoft}!hoptoad!chongo 40 * 41 * chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\ 42 */ 43 | 34 */ 35 36/* 37 * primes - generate a table of primes between two values 38 * 39 * By: Landon Curt Noll chongo@toad.com, ...!{sun,tolsoft}!hoptoad!chongo 40 * 41 * chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\ 42 */ 43 |
44#include <stdint.h> 45 |
|
44/* ubig is the type that holds a large unsigned value */ | 46/* ubig is the type that holds a large unsigned value */ |
45typedef unsigned long ubig; /* must be >=32 bit unsigned value */ | 47typedef uint64_t ubig; /* must be >=32 bit unsigned value */ |
46#define BIG ULONG_MAX /* largest value will sieve */ 47 48/* bytes in sieve table (must be > 3*5*7*11) */ 49#define TABSIZE 256*1024 50 51/* 52 * prime[i] is the (i-1)th prime. 53 * --- 22 unchanged lines hidden --- | 48#define BIG ULONG_MAX /* largest value will sieve */ 49 50/* bytes in sieve table (must be > 3*5*7*11) */ 51#define TABSIZE 256*1024 52 53/* 54 * prime[i] is the (i-1)th prime. 55 * --- 22 unchanged lines hidden --- |