1
0
Files
irix-657m-src/eoe/man/man1/factor.1
2022-09-29 17:59:04 +03:00

48 lines
1.2 KiB
Groff

'\"macro stdmacro
.if n .pH g1.factor @(#)factor 30.2 of 12/25/85
.nr X
.if \nX=0 .ds x} FACTOR 1 "User Environment Utilities" "\&"
.if \nX=1 .ds x} FACTOR 1 "User Environment Utilities"
.if \nX=2 .ds x} FACTOR 1 "" "\&"
.if \nX=3 .ds x} FACTOR "" "" "\&"
.TH \*(x}
.SH NAME
factor \- obtain the prime factors of a number
.SH SYNOPSIS
.B factor
[ integer ]
.SH DESCRIPTION
When you use
.I factor\^
without an argument, it waits for you to give it an integer.
After you give it
a positive integer less than or equal to 10 to the 14th (1.0e14),
it factors the integer, prints its prime factors
the proper number of times,
and then waits for another integer.
.I factor\^
exits if it encounters a zero or any non-numeric character.
.PP
If you invoke
.I factor\^
with an argument, it factors the integer
as described above, and then it exits.
.PP
The maximum time to factor an integer is proportional to
.if n sqrt(n),
.if t \(sr\o'\f2n\f1\(rn'.
.I factor\^
will take this time when
.I n\^
is prime
or the square of a prime.
.SH DIAGNOSTICS
\f2factor\f1 prints the error message,
"Ouch," for input out of range.
.I factor
prints the error message
``Q: undefined variable'' for garbage input.
.\" @(#)factor.1 6.2 of 9/2/83
.Ee
'\".so /pubs/tools/origin.att