home *** CD-ROM | disk | FTP | other *** search
-
-
-
- FFFFAAAACCCCTTTTOOOORRRR((((1111)))) FFFFAAAACCCCTTTTOOOORRRR((((1111))))
-
-
-
- NNNNAAAAMMMMEEEE
- factor - obtain the prime factors of a number
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ffffaaaaccccttttoooorrrr [ integer ]
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- When you use _f_a_c_t_o_r 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. _f_a_c_t_o_r
- exits if it encounters a zero or any non-numeric character.
-
- If you invoke _f_a_c_t_o_r with an argument, it factors the integer as
- described above, and then it exits.
-
- The maximum time to factor an integer is proportional to sqrt(n), _f_a_c_t_o_r
- will take this time when _n is prime or the square of a prime.
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- _f_a_c_t_o_r prints the error message, "Ouch," for input out of range. _f_a_c_t_o_r
- prints the error message ``Q: undefined variable'' for garbage input.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-