summaryrefslogtreecommitdiffstats
path: root/games/primes/primes.h
Commit message (Collapse)AuthorAgeFilesLines
* Final step of eliminating the "games" distribution: Merge src/gamescperciva2015-10-021-77/+0
| | | | | | | | | (or what's left of it, at least) into src/usr.bin. This change will not be MFCed. Discussed at: EuroBSDCon 2014 Committed from: EuroBSDCon 2015
* Switch primes(6) from using unsigned long to using uint64_t. This fixescperciva2014-09-271-1/+3
| | | | | 'limited range of type' warnings about comparisons on 32-bit systems, and allows 32-bit systems to compute the full range of primes.
* Correctly enumerate primes between 4295098369 and 3825123056546413050.cperciva2014-09-261-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this commit, primes(6) relied solely on sieving with primes up to 65537, with the effect that composite numbers which are the product of two non-16-bit primes would be incorrectly identified as prime. For example, # primes 1099511627800 1099511627820 would output 1099511627803 1099511627807 1099511627813 when in fact only the first of those values is prime. This commit adds strong pseudoprime tests to validate the candidates which pass the initial sieving stage, using bases of 2, 3, 5, 7, 11, 13, 17, 19, and 23. Thanks to papers from C. Pomerance, J.L. Selfridge, and S.S. Wagstaff, Jr.; G. Jaeschke; and Y. Jiang and Y. Deng, we know that the smallest value which passes these tests is 3825123056546413051. At present we do not know how many strong pseudoprime tests are required to prove primality for values larger than 3825123056546413050, so we force primes(6) to stop at that point. Reviewed by: jmg Relnotes: primes(6) now correctly enumerates primes up to 3825123056546413050 MFC after: 7 days Sponsored by: EuroBSDCon devsummit
* Remove the third clause for the Berkeley parts of games, per theimp2010-02-151-5/+1
| | | | letter in /COPYRIGHT.
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-1/+1
| | | | especially in troff files.
* Style fixes to: #include ordering; use const and static; ANSI functions;fanf2002-10-091-0/+18
| | | | | | | | | various usage synopses; bogus and/or unnecessary casting; exit values; use LINE_MAX instead of magic numbers; declare extern variables in a header; add $FreeBSD$ where missing. Reviewed by: markm, obrien Obtained from: NetBSD | fanf
* Bring in the 4.4 Lite games directory, modulo man page changes and segregationjkh1994-09-041-0/+52
of the x11 based games. I'm not going to tag the originals with bsd_44_lite and do this in two stages since it's just not worth it for this collection, and I've got directory renames to deal with that way. Bleah. Submitted by: jkh
OpenPOWER on IntegriCloud