primes.h revision 2490
1181344Sdfr/* 2181344Sdfr * Copyright (c) 1989, 1993 3208291Suqs * The Regents of the University of California. All rights reserved. 4181344Sdfr * 5181344Sdfr * This code is derived from software contributed to Berkeley by 6181344Sdfr * Landon Curt Noll. 7181344Sdfr * 8181344Sdfr * Redistribution and use in source and binary forms, with or without 9181344Sdfr * modification, are permitted provided that the following conditions 10181344Sdfr * are met: 11181344Sdfr * 1. Redistributions of source code must retain the above copyright 12181344Sdfr * notice, this list of conditions and the following disclaimer. 13181344Sdfr * 2. Redistributions in binary form must reproduce the above copyright 14181344Sdfr * notice, this list of conditions and the following disclaimer in the 15181344Sdfr * documentation and/or other materials provided with the distribution. 16181344Sdfr * 3. All advertising materials mentioning features or use of this software 17181344Sdfr * must display the following acknowledgement: 18181344Sdfr * This product includes software developed by the University of 19181344Sdfr * California, Berkeley and its contributors. 20181344Sdfr * 4. Neither the name of the University nor the names of its contributors 21181344Sdfr * may be used to endorse or promote products derived from this software 22181344Sdfr * without specific prior written permission. 23181344Sdfr * 24181344Sdfr * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25181344Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26181344Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27203026Sgavin * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28181344Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29181344Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30181344Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31181344Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32181344Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33181344Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34181344Sdfr * SUCH DAMAGE. 35181344Sdfr * 36181344Sdfr * @(#)primes.h 8.2 (Berkeley) 3/1/94 37181344Sdfr */ 38181344Sdfr 39181344Sdfr/* 40181344Sdfr * primes - generate a table of primes between two values 41181344Sdfr * 42181344Sdfr * By: Landon Curt Noll chongo@toad.com, ...!{sun,tolsoft}!hoptoad!chongo 43181344Sdfr * 44181344Sdfr * chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\ 45181344Sdfr */ 46181344Sdfr 47181344Sdfr/* ubig is the type that holds a large unsigned value */ 48181344Sdfrtypedef unsigned long ubig; /* must be >=32 bit unsigned value */ 49181344Sdfr#define BIG ULONG_MAX /* largest value will sieve */ 50181344Sdfr 51181344Sdfr/* bytes in sieve table (must be > 3*5*7*11) */ 52181344Sdfr#define TABSIZE 256*1024 53181344Sdfr