Commit | Line | Data |
---|---|---|
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 | 19 | factor, 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 |
27 | The |
28 | .I factor | |
29 | utility will factor integers between -2147483648 and 2147483647 inclusive. | |
30 | When a number is factored, it is printed, followed by a ``:'', | |
31 | and the list of factors on a single line. | |
32 | Factors are listed in ascending order, and are preceded by a space. | |
33 | If a factor divides a value more than once, it will be printed | |
34 | more than once. | |
35 | .PP | |
18ee5c99 KB |
36 | When |
37 | .I factor | |
bc2e2efb KB |
38 | is invoked with one or more arguments, |
39 | each argument will be factored. | |
18ee5c99 | 40 | .PP |
bc2e2efb KB |
41 | When |
42 | .I factor | |
43 | is invoked with no arguments, | |
18ee5c99 | 44 | .I factor |
bc2e2efb KB |
45 | reads numbers, one per line, from standard input, until end of file or error. |
46 | Leading white-space and empty lines are ignored. | |
47 | Numbers may be preceded by a single - or +. | |
48 | Numbers are terminated by a non-digit character (such as a newline). | |
49 | After a number is read, it is factored. | |
50 | Input lines must not be longer than 255 characters. | |
18ee5c99 | 51 | .PP |
bc2e2efb KB |
52 | The |
53 | .I primes | |
54 | utility prints primes in ascending order, one per line, starting at or above | |
55 | .B start | |
56 | and continuing until, but not including | |
57 | .B stop. | |
58 | The | |
59 | .B start | |
60 | value must be at least 0 and not greater than | |
61 | .B stop.\& | |
62 | The | |
63 | .B stop | |
64 | value must not be greater than 4294967295. | |
65 | The default value of | |
66 | .B stop | |
67 | is 4294967295. | |
18ee5c99 | 68 | .PP |
bc2e2efb | 69 | When the |
18ee5c99 | 70 | .I primes |
bc2e2efb KB |
71 | utility is invoked with no arguments, |
72 | .B start | |
73 | is read from standard input. | |
74 | .B Stop | |
75 | is taken to be 4294967295. | |
76 | The | |
77 | .B start | |
78 | value may be preceded by a single +. | |
79 | The | |
80 | .B start | |
81 | value is terminated by a non-digit character (such as a newline). | |
82 | The input line must not be longer than 255 characters. | |
18ee5c99 | 83 | .SH DIAGNOSTICS |
bc2e2efb KB |
84 | Out of range or invalid input results in `ouch' being |
85 | written to standard error. | |
86 | .SH BUGS | |
87 | .I Factor | |
88 | cannot handle the ``10 most wanted'' factor list, | |
89 | .I primes | |
90 | won't get you a world record. |