date and time created 94/04/13 10:27:13 by eric
[unix-history] / usr / src / games / factor / factor.6
CommitLineData
b9569f43
KB
1.\" Copyright (c) 1989, 1993
2.\" The Regents of the University of California. All rights reserved.
bc2e2efb
KB
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Landon Curt Noll.
6.\"
91cff1e1 7.\" %sccs.include.redist.man%
bc2e2efb 8.\"
b9569f43 9.\" @(#)factor.6 8.1 (Berkeley) %G%
bc2e2efb
KB
10.\"
11.\"
12.\" By: Landon Curt Noll chongo@toad.com, ...!{sun,tolsoft}!hoptoad!chongo
13.\"
14.\" chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\
15.\"
16.TH FACTOR 6 ""
17.UC 7
18ee5c99 18.SH NAME
bc2e2efb 19factor, primes \- factor a number, generate primes
18ee5c99
KB
20.SH SYNOPSIS
21.B factor
bc2e2efb 22[ number ] ...
18ee5c99
KB
23.PP
24.B primes
bc2e2efb 25[ start [ stop ]]
18ee5c99 26.SH DESCRIPTION
bc2e2efb
KB
27The
28.I factor
29utility will factor integers between -2147483648 and 2147483647 inclusive.
30When a number is factored, it is printed, followed by a ``:'',
31and the list of factors on a single line.
32Factors are listed in ascending order, and are preceded by a space.
33If a factor divides a value more than once, it will be printed
34more than once.
35.PP
18ee5c99
KB
36When
37.I factor
bc2e2efb
KB
38is invoked with one or more arguments,
39each argument will be factored.
18ee5c99 40.PP
bc2e2efb
KB
41When
42.I factor
43is invoked with no arguments,
18ee5c99 44.I factor
bc2e2efb
KB
45reads numbers, one per line, from standard input, until end of file or error.
46Leading white-space and empty lines are ignored.
47Numbers may be preceded by a single - or +.
48Numbers are terminated by a non-digit character (such as a newline).
49After a number is read, it is factored.
50Input lines must not be longer than 255 characters.
18ee5c99 51.PP
bc2e2efb
KB
52The
53.I primes
54utility prints primes in ascending order, one per line, starting at or above
55.B start
56and continuing until, but not including
57.B stop.
58The
59.B start
60value must be at least 0 and not greater than
61.B stop.\&
62The
63.B stop
64value must not be greater than 4294967295.
65The default value of
66.B stop
67is 4294967295.
18ee5c99 68.PP
bc2e2efb 69When the
18ee5c99 70.I primes
bc2e2efb
KB
71utility is invoked with no arguments,
72.B start
73is read from standard input.
74.B Stop
75is taken to be 4294967295.
76The
77.B start
78value may be preceded by a single +.
79The
80.B start
81value is terminated by a non-digit character (such as a newline).
82The input line must not be longer than 255 characters.
18ee5c99 83.SH DIAGNOSTICS
bc2e2efb
KB
84Out of range or invalid input results in `ouch' being
85written to standard error.
86.SH BUGS
87.I Factor
88cannot handle the ``10 most wanted'' factor list,
89.I primes
90won't get you a world record.