Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
.TH FACTOR 1 
2
.CT 1 numbers
3
.SH NAME
4
factor, primes \- factor a number, generate large primes
5
.SH SYNOPSIS
6
.B factor
7
[
8
.I number
9
]
10
.PP
11
.B primes
12
.I start
13
[
14
.I finish
15
]
16
.SH DESCRIPTION
17
.I Factor
18
prints
19
.I number
20
and its prime factors,
21
each repeated the proper number of times.
22
The number must be positive and less than
23
.if n 2**54
24
.if t 2\u\s754\s0\d
25
(about
26
.if n 1.8e16)
27
.if t 1.8\(mu10\u\s716\s0\d\|).
28
.PP
29
If no
30
.I number 
31
is given,
32
.I factor
33
reads a stream of numbers from the standard input and factors them.
34
It exits on any input not a positive integer.
35
Maximum running time is proportional to
36
.if n sqrt(n).
37
.if t .I \(sr\o'n\(rn'\f1.
38
.PP
39
.PP
40
.I Primes
41
prints the prime numbers ranging from
42
.I start
43
to
44
.IR finish ,
45
where
46
.I start
47
and
48
.I finish
49
are positive numbers less than 
50
.if n 2**56.
51
.if t 2\u\s756\s0\d.
52
If 
53
.I finish
54
is missing,
55
.I primes
56
prints without end;
57
if
58
.I start
59
is missing, it reads the starting number from the
60
standard input.
61
.SH SOURCE
62
.B /sys/src/cmd/factor.c
63
.br
64
.B /sys/src/cmd/primes.c