Set::In...ithmetic(3)

πŸ’– NAME πŸ’–

Okay bestie, you're reading Set::In...ithmetic(3), straight from the User Contributed Perl Documentation, and the actual module is Set::Infinite::Arithmetic. It's literally all about scalar operations used by quantize() and offset(). That's the whole vibe. ✨

🫢 AUTHOR 🫢

Flavio Soibelmann Glock - fglock@pucrs.br β€” show some love, that's the author. πŸ’œ

πŸŽ€ %_MODE hash of subs πŸŽ€

This hash is giving mode energy, fr fr. Here are the calls:

$a->offset ( value => [1,2], mode => 'offset', unit => 'days' );

$a->offset ( value => [1,2, -5,-4], mode => 'offset', unit => 'days' );
note: if mode = circle, then "-5" counts from end (like a Perl negative array index).

And then there's this one:

$a->offset ( value => [1,2], mode => 'offset', unit => 'days', strict => $a );
  • strict β€” option 'strict' will return intersection($a,offset). Default: none.

πŸ¦‹ %subs_offset2($object, $offset1, $offset2) πŸ¦‹

The call looks like this:

&{ $subs_offset2{$unit} } ($object, $offset1, $offset2);

A hash of functions that return:

($object+$offset1, $object+$offset2)

in $unit context.

Returned $object+$offset1, $object+$offset2 may be scalars or objects. πŸ‘‘

🌈 %Offset_to_value($object, $offset) & %Init_quantizer($object) 🌈

The calls are:

$Offset_to_value{$unit} ($object, $offset);

$Init_quantizer{$unit} ($object);

Maps an 'offset value' to a 'value'.

A hash of functions that return ( int($object) + $offset ) in $unit context.

Init_quantizer subroutines must be called before using subs_offset1 functions.

int(object)+offset is a scalar.

Offset_to_value is optimized for calling it multiple times on the same object, with different offsets. That's why there is a separate initialization subroutine.

$self->{offset} is created on initialization. It is an index used by the memoization cache. 🧚


That's the whole page, bestie! This gem is from perl v5.42.2, dated 2026-02-15, and the footer says Set::In...ithmetic(3). Go forth and offset/quantize with main character energy. πŸ’…βœ¨

πŸ“¦ where this page comes from