FACTOR(1)
π FACTOR(1) β the factor utility, but make it make sense
okay so bestie, this page is from User Contributed Perl Documentation and it's literally called FACTOR(1) β yes, the same lowercase factor your terminal already knows and loves. she factors numbers. that's the whole gig. and honestly? iconic.
β¨ SYNOPSIS β¨
% factor [number ...]
like yeah that's it. that's the girl. π
πΈ DESCRIPTION πΈ
so factor will factor positive integers for you, no cap. the maximum allowed input is system-dependent (iykyk, it's giving "ask your system, not me").
when a number gets factored, it's printed first, then a ':', then the list of factors β all on a single line. factors show up in ascending order, and each one is preceded by a space. and if a factor divides a value more than once, it gets printed more than once. periodt. π
when factor is invoked with one or more arguments, each argument gets factored. one by one. main character energy for every single one of them.
when factor is invoked with no arguments, she reads numbers from standard input, one per line, until end of file or error. and listen:
- leading white-space and empty lines are ignored π
- numbers may be preceded by a single
+π¦ - numbers are terminated by a non-digit character (such as a new-line) β
- after a number is read, it is factored β like, immediately. no waiting around. π
π BUGS π
factor has no known bugs. not me being flawless but go off. π₯
shoutout to Dana Jacobson, who provided a fix for numbers close to perfect squares. real ones know. π«Ά
π AUTHOR π
the Perl implementation of factor was written by Peter John Acklam, pjacklam@gmail.com. respectfully, thank you for your service. π
π COPYRIGHT and LICENSE π
this program is copyright (c) Peter John Acklam (2024).
this program is free and open software. you may use, modify, distribute, and sell this program (and any modified variants) in any way you wish β provided you do not restrict others from doing the same. like, the vibes have to stay free. that's the rule. π
and that's the whole page bestie, mwah π§ β brought to you by perl v5.42.2, dated 2026-02-15, and yes she's still serving FACTOR(1) at the bottom like the queen she is. π
β¨
π¦ where this page comes from
- alpine 3.24: perl-power-tools-doc 1.053-r1 Β· GPL-2.0-or-later AND Artistic-1.0-Perl AND Artistic-2.0 AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms