Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/factor Sync with reality. Bump date.



details:   https://anonhg.NetBSD.org/src/rev/1aa7b954e092
branches:  trunk
changeset: 754152:1aa7b954e092
user:      dholland <dholland%NetBSD.org@localhost>
date:      Thu Apr 22 04:42:21 2010 +0000

description:
Sync with reality. Bump date.

diffstat:

 games/factor/factor.6 |  38 +++++++++++++++++++++++++++-----------
 1 files changed, 27 insertions(+), 11 deletions(-)

diffs (71 lines):

diff -r 82548b2a08f1 -r 1aa7b954e092 games/factor/factor.6
--- a/games/factor/factor.6     Wed Apr 21 21:49:53 2010 +0000
+++ b/games/factor/factor.6     Thu Apr 22 04:42:21 2010 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: factor.6,v 1.9 2004/02/08 13:16:25 jsm Exp $
+.\"    $NetBSD: factor.6,v 1.10 2010/04/22 04:42:21 dholland 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 February 8, 2004
+.Dd April 22, 2010
 .Dt FACTOR 6
 .Os
 .Sh NAME
@@ -49,10 +49,12 @@
 .Sh DESCRIPTION
 The
 .Nm
-utility will factor integers between \-2147483648 and 2147483647 inclusive.
+utility factors positive integers.
 When a number is factored, it is printed, followed by a
 .Dq \&: ,
-and the list of factors on a single line.
+and the list of
+.Pq prime
+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.
 .Pp
@@ -66,16 +68,30 @@
 .Nm
 reads numbers, one per line, from standard input, until end of file or error.
 Leading white-space and empty lines are ignored.
-Numbers may be preceded by a single - or +.
+Numbers may be preceded by a single - or +, although negative numbers
+are rejected.
 Numbers are terminated by a non-digit character (such as a newline).
 After a number is read, it is factored.
-Input lines must not be longer than 255 characters.
+Input lines must not be longer than
+.Dv LINE_MAX - 1
+(currently 2047) characters.
+.Pp
+By default,
+.Nm
+is compiled against the OpenSSL bignum implementation
+.Xr openssl_bn 3 ,
+which lets it handle arbitrarily large values.
+.Pq Note however that very large values can take a very long time to factor.
+If
+.Nm
+is compiled without OpenSSL it is limited to the maximum value of
+.Vt unsigned long .
 .Sh DIAGNOSTICS
 Out of range or invalid input results in
 an appropriate error message
 being written to standard error.
-.Sh BUGS
-.Nm
-cannot handle the
-.Dq 10 most wanted
-factor list.
+.\".Sh BUGS
+.\".Nm
+.\"cannot handle the
+.\".Dq 10 most wanted
+.\"factor list.



Home | Main Index | Thread Index | Old Index