Math::N...itLength(3)

πŸ“¦
version 75 Β· 2 versions
, in fedora 43

πŸ’– 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 $value occurs 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