new upstream

git-svn-id: file:///srv/svn/joey/trunk/src/packages/bsdgames@10080 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
joey
2004-02-14 21:35:37 +00:00
parent 26fb70d304
commit a02c126403
224 changed files with 5624 additions and 2217 deletions

View File

@@ -1,4 +1,4 @@
.\" $NetBSD: factor.6,v 1.8 2003/08/07 09:37:12 agc Exp $
.\" $NetBSD: factor.6,v 1.9 2004/02/08 13:16:25 jsm Exp $
.\"
.\" Copyright (c) 1989, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -37,54 +37,45 @@
.\"
.\" chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\
.\"
.Dd May 31, 1993
.Dt PRIMES 6
.Dd February 8, 2004
.Dt FACTOR 6
.Os
.Sh NAME
.Nm primes
.Nd generate primes
.Nm factor
.Nd factor a number
.Sh SYNOPSIS
.Nm
.Op Ar number ...
.br
.Nm primes
.Op Ar start Op Ar stop
.Sh DESCRIPTION
The
.Nm primes
utility prints primes in ascending order, one per line, starting at or above
.Ar start
and continuing until, but not including
.Ar stop .
The
.Ar start
value must be at least 0 and not greater than
.Ar stop .
The
.Ar stop
value must not be greater than 4294967295.
The default value of
.Ar stop
is 4294967295.
.Nm
utility will factor integers between \-2147483648 and 2147483647 inclusive.
When a number is factored, it is printed, followed by a
.Dq \&: ,
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.
.Pp
When the
.Nm primes
utility is invoked with no arguments,
.Ar start
is read from standard input.
.Ar stop
is taken to be 4294967295.
The
.Ar start
value may be preceded by a single +.
The
.Ar start
value is terminated by a non-digit character (such as a newline).
The input line must not be longer than 255 characters.
When
.Nm
is invoked with one or more arguments, each argument will be factored.
.Pp
When
.Nm
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 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.
.Sh DIAGNOSTICS
Out of range or invalid input results in
.Sq ouch
an appropriate error message
being written to standard error.
.Sh BUGS
.Nm primes
won't get you a world record.
.Nm
cannot handle the
.Dq 10 most wanted
factor list.