From 2eb43769534644ef8af78e6a1fa70c755d41200b Mon Sep 17 00:00:00 2001 From: ast Date: Thu, 2 Oct 2014 21:36:37 +0000 Subject: Imported and adapted from FreeBSD svn r272166 and r272207; this fixes false positives for products of primes larger than 2^16. For example, before this commit: $ /usr/games/primes 4295360521 4295360522 4295360521 but $ /usr/games/factor 4295360521 4295360521: 65539 65539 or $ /usr/games/primes 3825123056546413049 3825123056546413050 3825123056546413049 yet $ /usr/games/factor 3825123056546413049 3825123056546413049: 165479 23115459100831 or $ /usr/games/primes 18446744073709551577 18446744073709551577 although $ /usr/games/factor 18446744073709551577 18446744073709551577: 139646831 132095686967 Incidentally, the above examples show the smallest and largest cases that were erroneously stated as prime in the range 2^32 .. 3825123056546413049 .. 2^64; the primes(6) program now stops at 3825123056546413050 as primality tests on larger integers would be by brute force factorization. In addition, special to the NetBSD version: . for -d option, skip first difference when start is >65537 as it is incorrect . corrected usage to mention both the existing -d as well as the new -h option For original FreeBSD commit message by Colin Percival, see: http://svnweb.freebsd.org/base?view=revision&revision=272166 --- primes/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'primes/Makefile') diff --git a/primes/Makefile b/primes/Makefile index 42350418..8ed845cd 100644 --- a/primes/Makefile +++ b/primes/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.7 2004/02/08 13:16:25 jsm Exp $ +# $NetBSD: Makefile,v 1.8 2014/10/02 21:36:37 ast Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 PROG= primes -SRCS= pattern.c pr_tbl.c primes.c +SRCS= pattern.c pr_tbl.c primes.c spsp.c MAN= primes.6 DPADD= ${LIBM} LDADD= -lm -- cgit v1.2.3-56-ge451