summaryrefslogtreecommitdiff
path: root/games/factor
diff options
context:
space:
mode:
authortb <tb@cvs.openbsd.org>2015-12-30 14:07:54 +0000
committertb <tb@cvs.openbsd.org>2015-12-30 14:07:54 +0000
commit2569438012db016cc7d2de2c49e1b751520be0f3 (patch)
tree757749749a20bad31d48539c3718873754f2af44 /games/factor
parentf73e3758610c84857f0590e7695e823a0e4103bc (diff)
Michal Mazurek pointed out on tech@ that the factor.6 manual needs a bit
of clarification. Thus, express the description both more concisely and more precisely. Drop details about spaces in the output formatting. While there, update the corresponding comment in the source code. With input from jmc@ and mestre@; detailed discussion with sobrado@. ok sobrado@
Diffstat (limited to 'games/factor')
-rw-r--r--games/factor/factor.610
-rw-r--r--games/factor/factor.c9
2 files changed, 8 insertions, 11 deletions
diff --git a/games/factor/factor.6 b/games/factor/factor.6
index d426ccbf779..b19ecc59a18 100644
--- a/games/factor/factor.6
+++ b/games/factor/factor.6
@@ -1,4 +1,4 @@
-.\" $OpenBSD: factor.6,v 1.12 2011/01/24 00:42:44 schwarze Exp $
+.\" $OpenBSD: factor.6,v 1.13 2015/12/30 14:07:53 tb Exp $
.\"
.\" Copyright (c) 1989, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -37,7 +37,7 @@
.\"
.\" chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\
.\"
-.Dd $Mdocdate: January 24 2011 $
+.Dd $Mdocdate: December 30 2015 $
.Dt FACTOR 6
.Os
.Sh NAME
@@ -55,10 +55,8 @@ The
utility will factor 64-bit positive integers.
When a number is factored, it is printed, followed by a
.Sq \&: ,
-and the list of factors on a single line.
-Factors are listed in ascending order, and are preceded by a space.
-If a factor divides a value more than once, it will be printed
-more than once.
+and the list of its prime factors in ascending order, on a single line.
+Every prime factor is printed as often as it divides the number.
.Pp
When
.Nm
diff --git a/games/factor/factor.c b/games/factor/factor.c
index 173f24be3d0..3cfeb8b3cd5 100644
--- a/games/factor/factor.c
+++ b/games/factor/factor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: factor.c,v 1.23 2015/12/25 20:59:09 mestre Exp $ */
+/* $OpenBSD: factor.c,v 1.24 2015/12/30 14:07:53 tb Exp $ */
/* $NetBSD: factor.c,v 1.5 1995/03/23 08:28:07 cgd Exp $ */
/*
@@ -143,17 +143,16 @@ main(int argc, char *argv[])
}
/*
- * pr_fact - print the factors of a number
+ * pr_fact - print the prime factors of a number
*
* If the number is 0 or 1, then print the number and return.
* If the number is < 0, print -1, negate the number and continue
* processing.
*
* Print the factors of the number, from the lowest to the highest.
- * A factor will be printed multiple times if it divides the value
- * multiple times.
+ * A prime factor will be printed as often as it divides the value.
*
- * Factors are printed with leading tabs.
+ * Prime factors are printed with leading spaces.
*/
void
pr_fact(u_int64_t val) /* Factor this value. */