summaryrefslogtreecommitdiff
path: root/sys/man/1/factor
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 16:49:47 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 16:49:47 +0300
commitb41b9034225ab3e49980d9de55c141011b6383b0 (patch)
tree891014b4c2e803e01ac7a1fd2b60819fbc5a6e73 /sys/man/1/factor
parentc558a99e0be506a9abdf677f0ca4490644e05fc1 (diff)
Import sources from 2011-03-30 iso image - sys/man
Diffstat (limited to 'sys/man/1/factor')
-rwxr-xr-xsys/man/1/factor64
1 files changed, 64 insertions, 0 deletions
diff --git a/sys/man/1/factor b/sys/man/1/factor
new file mode 100755
index 000000000..10baf9960
--- /dev/null
+++ b/sys/man/1/factor
@@ -0,0 +1,64 @@
+.TH FACTOR 1
+.CT 1 numbers
+.SH NAME
+factor, primes \- factor a number, generate large primes
+.SH SYNOPSIS
+.B factor
+[
+.I number
+]
+.PP
+.B primes
+.I start
+[
+.I finish
+]
+.SH DESCRIPTION
+.I Factor
+prints
+.I number
+and its prime factors,
+each repeated the proper number of times.
+The number must be positive and less than
+.if n 2**54
+.if t 2\u\s754\s0\d
+(about
+.if n 1.8e16)
+.if t 1.8\(mu10\u\s716\s0\d\|).
+.PP
+If no
+.I number
+is given,
+.I factor
+reads a stream of numbers from the standard input and factors them.
+It exits on any input not a positive integer.
+Maximum running time is proportional to
+.if n sqrt(n).
+.if t .I \(sr\o'n\(rn'\f1.
+.PP
+.PP
+.I Primes
+prints the prime numbers ranging from
+.I start
+to
+.IR finish ,
+where
+.I start
+and
+.I finish
+are positive numbers less than
+.if n 2**56.
+.if t 2\u\s756\s0\d.
+If
+.I finish
+is missing,
+.I primes
+prints without end;
+if
+.I start
+is missing, it reads the starting number from the
+standard input.
+.SH SOURCE
+.B /sys/src/cmd/factor.c
+.br
+.B /sys/src/cmd/primes.c