From eb31b3bcc14ed74d293c0d4da6ef8f76e4bbcee8 Mon Sep 17 00:00:00 2001 From: dholland Date: Thu, 22 Apr 2010 04:42:21 +0000 Subject: Sync with reality. Bump date. --- factor/factor.6 | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'factor/factor.6') diff --git a/factor/factor.6 b/factor/factor.6 index 4600bd34..2cb75b75 100644 --- a/factor/factor.6 +++ b/factor/factor.6 @@ -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 /\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 @@ is invoked with no arguments, .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. -- cgit v1.2.3-56-ge451