Math::N...:Modulo(3)

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

πŸ’– 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 $value actually shows up as a remainder, which means it's true when 0 <= $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::NumSeq
  • Math::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