Math::N...:Modulo(3)
π Math::NumSeq::Modulo β the manual, but make it cute π
okay bestie, so this is a page from the User Contributed Perl Documentation for Math::NumSeq::Modulo(3), and honestly? it's giving "tiny module, big personality." let's get into it π¦
β¨ NAME β¨
Math::NumSeq::Modulo β remainders modulo of a given number π
like, you know how you divide stuff and there's always some leftover? yeah. that's the whole vibe here.
πΈ SYNOPSIS πΈ
here's the entire energy in four lines, no cap:
use Math::NumSeq::Modulo;
my $seq = Math::NumSeq::Modulo->new (modulus => 123);
my ($i, $value) = $seq->next;
literally build the thing, set your modulus, and start pulling values. iconic. π
π¦ DESCRIPTION π¦
so it's a simple sequence of remainders β you pick a modulus, and you get the remainders of a given number against that modulus. that's it, that's the girl. π
for example, if your modulus is 5, you get:
0, 1, 2, 3, 4, 0, 1, 2, 3, 4, etc.
see how it just loops back around forever? main character energy fr fr. it never gets tired, it never changes the bit. π₯
π FUNCTIONS π
first things first β for the behaviour that every sequence class shares, go peek at "FUNCTIONS" in Math::NumSeq. that's the common ground, bestie. π
"$seq = Math::NumSeq::Modulo->new (modulus => $number)"β makes you a brand new sequence object and hands it right over. that's your whole constructor moment. β¨
π Random Access π
"$value = $seq->ith($i)"β gives you back"$i % $modulus". yeah. it's just the modulo. simple queen. π"$bool = $seq->pred($value)"β returns true if$valueactually shows up as a remainder, which means it's true when0 <= $value <= modulus-1. so like, if your value is in range, she's valid. if not? not on the guest list. π
π SEE ALSO π
go check out these siblings, they're all in the same family:
Math::NumSeqMath::NumSeq::Multiples
iykyk πΈ
π HOME PAGE π
<http://user42.tuxfamily.org/math-numseq/index.html>
that's where she lives. go say hi. π«Ά
β LICENSE β
Copyright 2010, 2011, 2012, 2013, 2014, 2016, 2017, 2018, 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.
ok so this is the important part, no skipping: you should have received a copy of the GNU General Public License along with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>. like, fr fr, go get your copy. π
and that's the whole page bestie π this was perl v5.42.0, dated 2025-07-25, and it's the Math::N...:Modulo(3) page β short, sweet, and fully slaying. periodt. π
β¨
π¦ 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