1Set::Infinite::ArithmetUisce(r3)Contributed Perl DocumenSteatt:i:oInnfinite::Arithmetic(3)
2
3
4
5   NAME
6       Set::Infinite::Arithmetic - Scalar operations used by quantize() and
7       offset()
8
9   AUTHOR
10       Flavio Soibelmann Glock - fglock@pucrs.br
11
12   %_MODE hash of subs
13           $a->offset ( value => [1,2], mode => 'offset', unit => 'days' );
14
15           $a->offset ( value => [1,2, -5,-4], mode => 'offset', unit => 'days' );
16
17       note: if mode = circle, then "-5" counts from end (like a Perl negative
18       array index).
19
20           $a->offset ( value => [1,2], mode => 'offset', unit => 'days', strict => $a );
21
22       option 'strict' will return intersection($a,offset). Default: none.
23
24   %subs_offset2($object, $offset1, $offset2)
25           &{ $subs_offset2{$unit} } ($object, $offset1, $offset2);
26
27       A hash of functions that return:
28
29           ($object+$offset1, $object+$offset2)
30
31       in $unit context.
32
33       Returned $object+$offset1, $object+$offset2 may be scalars or objects.
34
35   %Offset_to_value($object, $offset)
36   %Init_quantizer($object)
37           $Offset_to_value{$unit} ($object, $offset);
38
39           $Init_quantizer{$unit} ($object);
40
41       Maps an 'offset value' to a 'value'
42
43       A hash of functions that return ( int($object) + $offset ) in $unit
44       context.
45
46       Init_quantizer subroutines must be called before using subs_offset1
47       functions.
48
49       int(object)+offset is a scalar.
50
51       Offset_to_value is optimized for calling it multiple times on the same
52       object, with different offsets. That's why there is a separate
53       initialization subroutine.
54
55       $self->{offset} is created on initialization. It is an index used by
56       the memoization cache.
57
58
59
60perl v5.36.0                      2023-01-20      Set::Infinite::Arithmetic(3)
Impressum