Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: [netbsd-7] src/games
Module Name: src
Committed By: martin
Date: Sun Oct 5 10:21:04 UTC 2014
Modified Files:
src/games/factor [netbsd-7]: factor.6 factor.c
src/games/primes [netbsd-7]: Makefile pattern.c pr_tbl.c primes.6
primes.c primes.h
Added Files:
src/games/primes [netbsd-7]: spsp.c
Log Message:
Pull up following revision(s) (requested by ast in ticket #128):
games/primes/pattern.c: revision 1.7
games/primes/primes.h: revision 1.6
games/primes/spsp.c: revision 1.1
games/primes/Makefile: revision 1.8
games/factor/factor.c: revision 1.27
games/factor/factor.6: revision 1.13
games/primes/primes.c: revision 1.20
games/primes/primes.c: revision 1.21
games/primes/pr_tbl.c: revision 1.8
games/primes/primes.6: revision 1.4
games/primes/primes.6: revision 1.5
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
usage police
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.24.1 src/games/factor/factor.6
cvs rdiff -u -r1.26 -r1.26.18.1 src/games/factor/factor.c
cvs rdiff -u -r1.7 -r1.7.74.1 src/games/primes/Makefile \
src/games/primes/pr_tbl.c
cvs rdiff -u -r1.6 -r1.6.74.1 src/games/primes/pattern.c
cvs rdiff -u -r1.3 -r1.3.46.1 src/games/primes/primes.6
cvs rdiff -u -r1.19 -r1.19.20.1 src/games/primes/primes.c
cvs rdiff -u -r1.5 -r1.5.74.1 src/games/primes/primes.h
cvs rdiff -u -r0 -r1.1.2.2 src/games/primes/spsp.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index