summaryrefslogtreecommitdiffstats
path: root/games/factor
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2014-11-19 01:07:58 +0000
committersjg <sjg@FreeBSD.org>2014-11-19 01:07:58 +0000
commitb137080f19736ee33fede2e88bb54438604cf86b (patch)
tree377ac0ac449528621eb192cd245adadb5fd53668 /games/factor
parentab21a29eb607d4dfe389b965fbdee27558e791aa (diff)
parent4a8d07956d121238d006d34ffe7d6269744e8b1a (diff)
downloadFreeBSD-src-b137080f19736ee33fede2e88bb54438604cf86b.zip
FreeBSD-src-b137080f19736ee33fede2e88bb54438604cf86b.tar.gz
Merge from head@274682
Diffstat (limited to 'games/factor')
-rw-r--r--games/factor/factor.69
-rw-r--r--games/factor/factor.c3
2 files changed, 9 insertions, 3 deletions
diff --git a/games/factor/factor.6 b/games/factor/factor.6
index a4d35e9..ba82f14 100644
--- a/games/factor/factor.6
+++ b/games/factor/factor.6
@@ -89,8 +89,7 @@ The
value must not be greater than the maximum.
The default and maximum value of
.Ar stop
-is 4294967295 on 32-bit architectures
-and 18446744073709551615 on 64-bit ones.
+is 3825123056546413050.
.Pp
When the
.Nm primes
@@ -120,3 +119,9 @@ cannot handle the
factor list,
.Nm primes
will not get you a world record.
+.Pp
+.Nm primes
+is unable to list primes between 3825123056546413050 and 18446744073709551615
+since it relies on strong pseudoprime tests after sieving, and nobody has
+proven how many strong pseudoprime tests are required to prove primality for
+integers larger than 3825123056546413050.
diff --git a/games/factor/factor.c b/games/factor/factor.c
index 8b76c17..19fe830 100644
--- a/games/factor/factor.c
+++ b/games/factor/factor.c
@@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <err.h>
#include <errno.h>
+#include <inttypes.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
@@ -227,7 +228,7 @@ pr_fact(BIGNUM *val)
/* Divide factor out until none are left. */
do {
- printf(hflag ? " 0x%lx" : " %lu", *fact);
+ printf(hflag ? " 0x%" PRIx64 "" : " %" PRIu64 "", *fact);
BN_div_word(val, (BN_ULONG)*fact);
} while (BN_mod_word(val, (BN_ULONG)*fact) == 0);
OpenPOWER on IntegriCloud