factor — Obtain the Prime Factors of a Number

Synopsis

/usr/bin/factor [integer] 

Description

factor writes to standard input all prime factors for any positive integer of fewer than 15 digits. The prime factors are written the proper number of times.

If you type factor without an argument, it waits for you to type an integer and press Return. After you enter the integer, factor factors it, writes its prime factors the proper number of times, and then waits for another integer. factor exits if you enter a 0 or any nonnumeric character.

If you invoke factor with an argument (integer ), it writes the integer, factors it, writes all the prime factors as described above, and then exits. If the argument is 0 or nonnumeric, factor writes a 0 and ...

Get Solaris™ 7 Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.