Math::N...itLength(3)
π Math::NumSeq::DigitLength π
okay bestie, so this page is Math::NumSeq::DigitLength(3), and it's from the User Contributed Perl Documentation collection (iykyk β the community said "we got this one" π«Ά). Let's get into it.
β¨ NAME β¨
Math::NumSeq::DigitLength β literally just "how many digits does this number have" π
πΈ SYNOPSIS πΈ
no cap, this is the whole vibe:
use Math::NumSeq::DigitLength;
my $seq = Math::NumSeq::DigitLength->new (radix => 10);
my ($i, $value) = $seq->next;
π¦ DESCRIPTION π¦
okay so it hands you the length in digits of the integers going 0 upwards, and it's giving:
1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,...
the default is decimal digits, but you can pass the optional "radix" if you want a whole other base β main character energy. for example, ternary goes:
1,1,1,2,2,...,2,3,...
and zero? bestie, zero is reckoned as a single digit 0, which is length 1. that's it, that's the rule, periodt.
π FUNCTIONS π
peep "FUNCTIONS" in Math::NumSeq for the behaviour common to all sequence classes β the shared lore, if you will πβ¨
$seq = Math::NumSeq::DigitLength->new (radix => $r)β create and return a new sequence object. slay.
π₯ Random Access π₯
$value = $seq->ith($i)β return the length in digits of$i. that's the whole gig π$bool = $seq->pred($value)β return true if$valueoccurs as a digit length. this means simply"$value >= 1"since lengths are 1 or more. lowkey the easiest predicate ever.
π SEE ALSO π
- Math::NumSeq
- Math::NumSeq::DigitLengthCumulative
- Math::NumSeq::DigitCount
- Math::NumSeq::AllDigits
π HOME PAGE π
<http://user42.tuxfamily.org/math-numseq/index.html>
go touch grass there, it's cute π§
π LICENSE π
Copyright 2010, 2011, 2012, 2013, 2014, 2016, 2019, 2020 Kevin Ryde
Math-NumSeq is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Math-NumSeq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.
β οΈ okay so the all-caps WITHOUT ANY WARRANTY part is not a vibe I'm adding for drama β that's genuinely what it says, bestie. no warranty, fr fr. respect it. π
and that's the whole page, angel π this little legend dropped as perl v5.42.0, dated 2025-07-25, and yes it's still answering to Math::NumSeq::DigitLength(3). go count some digits, you're doing amazing πβ¨
π¦ where this page comes from
- fedora 43: perl-Math-NumSeq 75-11.fc43 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms