freebsd-skq/games
Tony Finch 38281fea3e Fix a performance bug in factor(6).
Check if large factor is prime before applying Pollard's algorithm;
fixes "factor 2147483647111311".  Increase base if p-1 algorithm
reaches 1; fixes "factor 99999999999991".

Testcases from David A Bagley <bagleyd@tux.org>.
Fixes from Joseph Myers <jsm@NetBSD.org>.
Problem rediscovered by an attempt to factor my phone number.

A few other incidental fixes: correct a couple of factually incorrect
comments; use ident string macros; move from 4-clause to 3-clause
BSD licence (University of California copyright).

Obtained from:	NetBSD
2009-11-26 00:38:13 +00:00
..
bcd
caesar
factor Fix a performance bug in factor(6). 2009-11-26 00:38:13 +00:00
fortune Properly sort a math fortune after the changes in r193486 2009-11-07 22:13:29 +00:00
grdc
morse Fixed the output grammar to properly speak non-terminal dits. 2008-06-08 19:35:47 +00:00
number Make number(6) build with WARNS=6. 2009-10-13 06:25:53 +00:00
pom
ppt
primes
random Suggections from bde@ 2008-08-11 23:24:42 +00:00
Makefile
Makefile.inc