Lines Matching defs:primes
1 /* $NetBSD: primes.c,v 1.22 2018/02/03 15:40:29 christos Exp $ */
43 static char sccsid[] = "@(#)primes.c 8.5 (Berkeley) 5/10/95";
45 __RCSID("$NetBSD: primes.c,v 1.22 2018/02/03 15:40:29 christos Exp $");
50 * primes - generate a table of primes between two values
55 * primes [-dh] [start [stop]]
57 * Print primes >= start and < stop. If stop is omitted,
61 * -h: print primes in hexadecimal
63 * validation check: there are 664579 primes between 0 and 10^7
77 #include "primes.h"
92 static void primes(uint64_t, uint64_t);
170 primes(start, stop);
206 * primes - sieve and print primes from start up to and but not including stop
209 primes(uint64_t start, uint64_t stop)
245 * quick list of primes <= pr_limit
248 /* skip primes up to the start value */
268 * we shall sieve a bytemap window, note primes and move the window
287 * sieve for primes 17 and higher
316 * print generated primes
338 (void)fprintf(stderr, "usage: primes [-dh] [start [stop]]\n");