Math::NumSeq::Even(3)

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

πŸ’– Math::NumSeq::Even β€” the manual, but make it cute ✨

okay bestie, so you're looking at Math::NumSeq::Even, which lives in the Math::NumSeq family of Perl modules, and it is literally just the even integers. That's it. That's the whole vibe. She's simple, she's iconic, she understood the assignment. πŸ‘‘


🌸 NAME 🌸

Math::NumSeq::Even β€” even integers πŸ’…


✨ SYNOPSIS ✨

here's the whole thing in action, no notes:

use Math::NumSeq::Even;
my $seq = Math::NumSeq::Even->new;
my ($i, $value) = $seq->next;

like. she's thriving. πŸ¦‹


πŸŽ€ DESCRIPTION πŸŽ€

it's the even integers, bestie:

0, 2, 4, 6, 8, 10, ...
starting i=0

that's the sequence. zero, two, four, six, eight, ten, and she keeps going forever because she has main character energy and does not stop. 🌈


πŸ’– FUNCTIONS πŸ’–

for the stuff that's shared across all the sequence classes, go peek at "FUNCTIONS" in Math::NumSeq β€” that's the group chat everyone's in. 🫢

  • $seq = Math::NumSeq::Even->new () β€” makes a brand new sequence object and hands it to you. fresh out of the box, no cap.

🧚 Iterating

  • $seq->seek_to_i($i) β€” slides the current position of the sequence over to $i. the very next time you call next(), it's gonna hand you back $i plus the matching value. so cute. ✨
  • $seq->seek_to_value($value) β€” moves the current i around so that next() gives you $value on the next call. oh and heads up β€” if $value is an even integer, you get the next higher even instead. lowkey important, don't forget it. πŸ™ˆ

πŸ’œ Random Access

  • $value = $seq->ith($i) β€” returns 2*$i. that's it. math is mathing. πŸ”₯
  • $bool = $seq->pred($value) β€” returns true if $value is even. vibe check passed βœ…
  • $i = $seq->value_to_i_ceil($value)
  • $i = $seq->value_to_i_floor($value) β€” returns value/2, rounded up or down to the next integer. pick your fighter. πŸ’…
  • $i = $seq->value_to_i_estimate($value) β€” returns an estimate of the i that corresponds to $value. it's giving approximation, it's giving ballpark, and honestly? we respect it. 🌸

πŸ‘€ SEE ALSO πŸ‘€

  • Math::NumSeq
  • Math::NumSeq::Odd
  • Math::NumSeq::All

the whole squad. go say hi. 🫢


🌐 HOME PAGE 🌐

<http://user42.tuxfamily.org/math-numseq/index.html>


πŸ“œ 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/>.

fr fr read the license, it's giving legally binding and she means it 😭

and that's the whole page babes πŸ’– this was perl v5.42.0, dated 2025-07-25, from Math::NumSeq::Even(3) β€” thanks for coming to my ted talk, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from