factor(1)


factor -- obtain the prime factors of a number

Synopsis

factor [integer]

Description

When you use factor without an argument, it waits for you to give it an integer. After you give it a positive integer less than 10[14], it factors the integer, prints its prime factors the proper number of times, and then waits for another integer. factor exits if it encounters a zero or any non-numeric character.

If you invoke factor with an argument, it factors the integer as described above, and then it exits.

The maximum time to factor an integer is proportional to SQUARE ROOT(n). factor will take this time when n is prime or the square of a prime.

Diagnostics

factor prints the error message, Ouch!, for input out of range.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004