On Sat, Dec 26, 2015 at 11:09:35PM +0100, Theo Buehler wrote: > On Sat, Dec 26, 2015 at 09:57:57PM +0000, Jason McIntyre wrote: > > On Sat, Dec 26, 2015 at 10:01:34AM +0100, Michal Mazurek wrote: > > > Index: factor.6 > > > =================================================================== > > > RCS file: /cvs/src/games/factor/factor.6,v > > > retrieving revision 1.12 > > > diff -u -p -r1.12 factor.6 > > > --- factor.6 24 Jan 2011 00:42:44 -0000 1.12 > > > +++ factor.6 26 Dec 2015 08:56:37 -0000 > > > @@ -58,7 +58,7 @@ When a number is factored, it is printed > > > 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. > > > +that number of times. > > > .Pp > > > When > > > .Nm > > > > > > > i am not the right guy to take this but i want to point out that > > the source code has virtually the same comment as the man page, so > > if someone agrees the man page needs changed they might want to > > bump the source code too.
Maybe we should just go all the way: o 'factor' is synonymous with 'divisor', so we should really say 'prime factor', not only 'factor'. o Incorporate my previous suggestion 'every prime factor is printed as often as it divides the number'. o follow jmc@'s suggestion to update the comment in the source code as well Index: factor.6 =================================================================== RCS file: /var/cvs/src/games/factor/factor.6,v retrieving revision 1.12 diff -u -p -r1.12 factor.6 --- factor.6 24 Jan 2011 00:42:44 -0000 1.12 +++ factor.6 26 Dec 2015 22:34:55 -0000 @@ -55,10 +55,10 @@ 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 on a single line. +The prime factors are listed in ascending order, and are +preceded by a space. +Every prime factor is printed as often as it divides the number. .Pp When .Nm Index: factor.c =================================================================== RCS file: /var/cvs/src/games/factor/factor.c,v retrieving revision 1.23 diff -u -p -r1.23 factor.c --- factor.c 25 Dec 2015 20:59:09 -0000 1.23 +++ factor.c 26 Dec 2015 22:22:35 -0000 @@ -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. */