line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Venus::Number; |
2
|
|
|
|
|
|
|
|
3
|
17
|
|
|
17
|
|
402
|
use 5.018; |
|
17
|
|
|
|
|
70
|
|
4
|
|
|
|
|
|
|
|
5
|
17
|
|
|
17
|
|
109
|
use strict; |
|
17
|
|
|
|
|
39
|
|
|
17
|
|
|
|
|
374
|
|
6
|
17
|
|
|
17
|
|
97
|
use warnings; |
|
17
|
|
|
|
|
38
|
|
|
17
|
|
|
|
|
508
|
|
7
|
|
|
|
|
|
|
|
8
|
17
|
|
|
17
|
|
109
|
use Venus::Class 'base'; |
|
17
|
|
|
|
|
35
|
|
|
17
|
|
|
|
|
138
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
base 'Venus::Kind::Value'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use overload ( |
13
|
12
|
|
|
12
|
|
72
|
'!' => sub{!$_[0]->get}, |
14
|
0
|
|
|
0
|
|
0
|
'!=' => sub{$_[0]->get != ($_[1] + 0)}, |
15
|
0
|
|
|
0
|
|
0
|
'%' => sub{$_[0]->get % ($_[1] + 0)}, |
16
|
0
|
|
|
0
|
|
0
|
'*' => sub{$_[0]->get * ($_[1] + 0)}, |
17
|
0
|
|
|
0
|
|
0
|
'+' => sub{$_[0]->get + ($_[1] + 0)}, |
18
|
0
|
|
|
0
|
|
0
|
'-' => sub{$_[0]->get - ($_[1] + 0)}, |
19
|
0
|
|
|
0
|
|
0
|
'/' => sub{$_[0]->get / ($_[1] + 0)}, |
20
|
0
|
|
|
0
|
|
0
|
'0+' => sub{$_[0]->get + 0}, |
21
|
0
|
|
|
0
|
|
0
|
'<' => sub{$_[0]->get < ($_[1] + 0)}, |
22
|
0
|
|
|
0
|
|
0
|
'<=' => sub{$_[0]->get <= ($_[1] + 0)}, |
23
|
1
|
|
|
1
|
|
4
|
'==' => sub{$_[0]->get == ($_[1] + 0)}, |
24
|
0
|
|
|
0
|
|
0
|
'>' => sub{$_[0]->get > ($_[1] + 0)}, |
25
|
0
|
|
|
0
|
|
0
|
'>=' => sub{$_[0]->get >= ($_[1] + 0)}, |
26
|
41
|
|
|
41
|
|
1734
|
'bool' => sub{$_[0]->get + 0}, |
27
|
0
|
|
|
0
|
|
0
|
'eq' => sub{"$_[0]" eq "$_[1]"}, |
28
|
0
|
|
|
0
|
|
0
|
'ne' => sub{"$_[0]" ne "$_[1]"}, |
29
|
0
|
|
|
0
|
|
0
|
'qr' => sub{qr/@{[quotemeta($_[0]->get)]}/}, |
|
0
|
|
|
|
|
0
|
|
30
|
0
|
|
|
0
|
|
0
|
'x' => sub{$_[0]->get x ($_[1] + 0)}, |
31
|
17
|
|
|
|
|
662
|
fallback => 1, |
32
|
17
|
|
|
17
|
|
167
|
); |
|
17
|
|
|
|
|
42
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# METHODS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub abs { |
37
|
3
|
|
|
3
|
1
|
13
|
my ($self) = @_; |
38
|
|
|
|
|
|
|
|
39
|
3
|
|
|
|
|
11
|
my $data = $self->get; |
40
|
|
|
|
|
|
|
|
41
|
3
|
|
|
|
|
16
|
return CORE::abs($data); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub add { |
45
|
1
|
|
|
1
|
1
|
6
|
my ($self, $arg) = @_; |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
|
|
4
|
my $data = $self->get; |
48
|
|
|
|
|
|
|
|
49
|
1
|
|
|
|
|
14
|
return $data + ($arg + 0); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub append { |
53
|
1
|
|
|
1
|
1
|
6
|
my ($self, @args) = @_; |
54
|
|
|
|
|
|
|
|
55
|
1
|
|
|
|
|
11
|
return $self->append_with(undef, @args); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub append_with { |
59
|
2
|
|
|
2
|
1
|
9
|
my ($self, $delimiter, @args) = @_; |
60
|
|
|
|
|
|
|
|
61
|
2
|
|
|
|
|
12
|
my $data = $self->get; |
62
|
|
|
|
|
|
|
|
63
|
2
|
|
100
|
|
|
28
|
return CORE::join($delimiter // '', $data, @args); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub assertion { |
67
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
0
|
my $assertion = $self->SUPER::assertion; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
$assertion->match('float')->format(sub{ |
72
|
0
|
|
0
|
0
|
|
0
|
(ref $self || $self)->new($_) |
73
|
0
|
|
|
|
|
0
|
}); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
$assertion->match('number')->format(sub{ |
76
|
0
|
|
0
|
0
|
|
0
|
(ref $self || $self)->new($_) |
77
|
0
|
|
|
|
|
0
|
}); |
78
|
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
0
|
return $assertion; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub atan2 { |
83
|
1
|
|
|
1
|
1
|
4
|
my ($self, $arg) = @_; |
84
|
|
|
|
|
|
|
|
85
|
1
|
|
|
|
|
5
|
my $data = $self->get; |
86
|
|
|
|
|
|
|
|
87
|
1
|
|
|
|
|
23
|
return CORE::atan2($data, $arg + 0); |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub comparer { |
91
|
220
|
|
|
220
|
0
|
529
|
my ($self) = @_; |
92
|
|
|
|
|
|
|
|
93
|
220
|
|
|
|
|
804
|
return 'numified'; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub concat { |
97
|
1
|
|
|
1
|
1
|
5
|
my ($self, @args) = @_; |
98
|
|
|
|
|
|
|
|
99
|
1
|
|
|
|
|
6
|
my $data = $self->get; |
100
|
|
|
|
|
|
|
|
101
|
1
|
|
|
|
|
9
|
return CORE::join('', $data, @args); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub contains { |
105
|
3
|
|
|
3
|
1
|
10
|
my ($self, $pattern) = @_; |
106
|
|
|
|
|
|
|
|
107
|
3
|
|
|
|
|
11
|
my $data = $self->get; |
108
|
|
|
|
|
|
|
|
109
|
3
|
50
|
|
|
|
10
|
return 0 unless CORE::defined($pattern); |
110
|
|
|
|
|
|
|
|
111
|
3
|
|
|
|
|
15
|
my $regexp = UNIVERSAL::isa($pattern, 'Regexp'); |
112
|
|
|
|
|
|
|
|
113
|
3
|
100
|
|
|
|
19
|
return CORE::index($data, $pattern) < 0 ? 0 : 1 if !$regexp; |
|
|
100
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
115
|
1
|
50
|
|
|
|
13
|
return ($data =~ $pattern) ? true : false; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
sub cos { |
119
|
1
|
|
|
1
|
1
|
4
|
my ($self) = @_; |
120
|
|
|
|
|
|
|
|
121
|
1
|
|
|
|
|
4
|
my $data = $self->get; |
122
|
|
|
|
|
|
|
|
123
|
1
|
|
|
|
|
45
|
return CORE::cos($data); |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub decr { |
127
|
2
|
|
|
2
|
1
|
7
|
my ($self, $arg) = @_; |
128
|
|
|
|
|
|
|
|
129
|
2
|
|
|
|
|
8
|
my $data = $self->get; |
130
|
|
|
|
|
|
|
|
131
|
2
|
|
100
|
|
|
16
|
return $data - (($arg || 1) + 0); |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub default { |
135
|
|
|
|
|
|
|
|
136
|
183
|
|
|
183
|
1
|
848
|
return 0; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub div { |
140
|
1
|
|
|
1
|
1
|
5
|
my ($self, $arg) = @_; |
141
|
|
|
|
|
|
|
|
142
|
1
|
|
|
|
|
5
|
my $data = $self->get; |
143
|
|
|
|
|
|
|
|
144
|
1
|
|
|
|
|
9
|
return $data / ($arg + 0); |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
sub exp { |
148
|
3
|
|
|
3
|
1
|
9
|
my ($self) = @_; |
149
|
|
|
|
|
|
|
|
150
|
3
|
|
|
|
|
13
|
my $data = $self->get; |
151
|
|
|
|
|
|
|
|
152
|
3
|
|
|
|
|
33
|
return CORE::exp($data); |
153
|
|
|
|
|
|
|
} |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
sub hex { |
156
|
1
|
|
|
1
|
1
|
4
|
my ($self) = @_; |
157
|
|
|
|
|
|
|
|
158
|
1
|
|
|
|
|
4
|
my $data = $self->get; |
159
|
|
|
|
|
|
|
|
160
|
1
|
|
|
|
|
9
|
return CORE::sprintf('%#x', $data); |
161
|
|
|
|
|
|
|
} |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
sub incr { |
164
|
15
|
|
|
15
|
1
|
34
|
my ($self, $arg) = @_; |
165
|
|
|
|
|
|
|
|
166
|
15
|
|
|
|
|
43
|
my $data = $self->get; |
167
|
|
|
|
|
|
|
|
168
|
15
|
|
100
|
|
|
97
|
return $data + (($arg || 1) + 0); |
169
|
|
|
|
|
|
|
} |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
sub index { |
172
|
3
|
|
|
3
|
1
|
10
|
my ($self, $substr, $start) = @_; |
173
|
|
|
|
|
|
|
|
174
|
3
|
|
|
|
|
9
|
my $data = $self->get; |
175
|
|
|
|
|
|
|
|
176
|
3
|
100
|
|
|
|
22
|
return CORE::index($data, $substr) if not(CORE::defined($start)); |
177
|
1
|
|
|
|
|
13
|
return CORE::index($data, $substr, $start); |
178
|
|
|
|
|
|
|
} |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
sub int { |
181
|
1
|
|
|
1
|
1
|
4
|
my ($self) = @_; |
182
|
|
|
|
|
|
|
|
183
|
1
|
|
|
|
|
6
|
my $data = $self->get; |
184
|
|
|
|
|
|
|
|
185
|
1
|
|
|
|
|
11
|
return CORE::int($data); |
186
|
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
sub length { |
189
|
1
|
|
|
1
|
1
|
3
|
my ($self) = @_; |
190
|
|
|
|
|
|
|
|
191
|
1
|
|
|
|
|
5
|
my $data = $self->get; |
192
|
|
|
|
|
|
|
|
193
|
1
|
|
|
|
|
11
|
return CORE::length($data); |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
sub log { |
197
|
1
|
|
|
1
|
1
|
41
|
my ($self) = @_; |
198
|
|
|
|
|
|
|
|
199
|
1
|
|
|
|
|
9
|
my $data = $self->get; |
200
|
|
|
|
|
|
|
|
201
|
1
|
|
|
|
|
23
|
return CORE::log($data); |
202
|
|
|
|
|
|
|
} |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
sub lshift { |
205
|
1
|
|
|
1
|
1
|
4
|
my ($self, $arg) = @_; |
206
|
|
|
|
|
|
|
|
207
|
1
|
|
|
|
|
5
|
my $data = $self->get; |
208
|
|
|
|
|
|
|
|
209
|
1
|
|
|
|
|
15
|
return $data << ($arg + 0); |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
sub mod { |
213
|
3
|
|
|
3
|
1
|
9
|
my ($self, $arg) = @_; |
214
|
|
|
|
|
|
|
|
215
|
3
|
|
|
|
|
10
|
my $data = $self->get; |
216
|
|
|
|
|
|
|
|
217
|
3
|
|
|
|
|
16
|
return $data % ($arg + 0); |
218
|
|
|
|
|
|
|
} |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
sub multi { |
221
|
1
|
|
|
1
|
1
|
4
|
my ($self, $arg) = @_; |
222
|
|
|
|
|
|
|
|
223
|
1
|
|
|
|
|
4
|
my $data = $self->get; |
224
|
|
|
|
|
|
|
|
225
|
1
|
|
|
|
|
17
|
return $data * ($arg + 0); |
226
|
|
|
|
|
|
|
} |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
sub neg { |
229
|
1
|
|
|
1
|
1
|
15
|
my ($self) = @_; |
230
|
|
|
|
|
|
|
|
231
|
1
|
|
|
|
|
10
|
my $data = $self->get; |
232
|
|
|
|
|
|
|
|
233
|
1
|
50
|
|
|
|
10
|
return $data =~ /^-(.*)/ ? $1 : -$data; |
234
|
|
|
|
|
|
|
} |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
sub numified { |
237
|
380
|
|
|
380
|
1
|
999
|
my ($self) = @_; |
238
|
|
|
|
|
|
|
|
239
|
380
|
|
|
|
|
1612
|
my $data = $self->get; |
240
|
|
|
|
|
|
|
|
241
|
380
|
|
|
|
|
2893
|
return 0 + $data; |
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
sub pow { |
245
|
1
|
|
|
1
|
1
|
4
|
my ($self, $arg) = @_; |
246
|
|
|
|
|
|
|
|
247
|
1
|
|
|
|
|
5
|
my $data = $self->get; |
248
|
|
|
|
|
|
|
|
249
|
1
|
|
|
|
|
15
|
return $data ** ($arg + 0); |
250
|
|
|
|
|
|
|
} |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
sub prepend { |
253
|
1
|
|
|
1
|
1
|
7
|
my ($self, @args) = @_; |
254
|
|
|
|
|
|
|
|
255
|
1
|
|
|
|
|
6
|
return $self->prepend_with(undef, @args); |
256
|
|
|
|
|
|
|
} |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
sub prepend_with { |
259
|
2
|
|
|
2
|
1
|
8
|
my ($self, $delimiter, @args) = @_; |
260
|
|
|
|
|
|
|
|
261
|
2
|
|
|
|
|
7
|
my $data = $self->get; |
262
|
|
|
|
|
|
|
|
263
|
2
|
|
100
|
|
|
22
|
return CORE::join($delimiter // '', @args, $data); |
264
|
|
|
|
|
|
|
} |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
sub range { |
267
|
2
|
|
|
2
|
1
|
7
|
my ($self, $arg) = @_; |
268
|
|
|
|
|
|
|
|
269
|
2
|
|
|
|
|
10
|
my $data = $self->get; |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
return [ |
272
|
2
|
100
|
|
|
|
23
|
($data > ($arg + 0)) ? CORE::reverse(($arg + 0)..$data) : ($data..($arg + 0)) |
273
|
|
|
|
|
|
|
]; |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
sub repeat { |
277
|
2
|
|
|
2
|
1
|
7
|
my ($self, $count, $delimiter) = @_; |
278
|
|
|
|
|
|
|
|
279
|
2
|
|
|
|
|
9
|
my $data = $self->get; |
280
|
|
|
|
|
|
|
|
281
|
2
|
|
100
|
|
|
34
|
return CORE::join($delimiter // '', CORE::map $data, 1..($count || 1)); |
|
|
|
50
|
|
|
|
|
282
|
|
|
|
|
|
|
} |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
sub rshift { |
285
|
1
|
|
|
1
|
1
|
3
|
my ($self, $arg) = @_; |
286
|
|
|
|
|
|
|
|
287
|
1
|
|
|
|
|
5
|
my $data = $self->get; |
288
|
|
|
|
|
|
|
|
289
|
1
|
|
|
|
|
8
|
return $data >> ($arg + 0); |
290
|
|
|
|
|
|
|
} |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
sub sin { |
293
|
1
|
|
|
1
|
1
|
6
|
my ($self) = @_; |
294
|
|
|
|
|
|
|
|
295
|
1
|
|
|
|
|
5
|
my $data = $self->get; |
296
|
|
|
|
|
|
|
|
297
|
1
|
|
|
|
|
23
|
return CORE::sin($data); |
298
|
|
|
|
|
|
|
} |
299
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
sub sqrt { |
301
|
1
|
|
|
1
|
1
|
6
|
my ($self) = @_; |
302
|
|
|
|
|
|
|
|
303
|
1
|
|
|
|
|
4
|
my $data = $self->get; |
304
|
|
|
|
|
|
|
|
305
|
1
|
|
|
|
|
8
|
return CORE::sqrt($data); |
306
|
|
|
|
|
|
|
} |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
sub sub { |
309
|
1
|
|
|
1
|
1
|
4
|
my ($self, $arg) = @_; |
310
|
|
|
|
|
|
|
|
311
|
1
|
|
|
|
|
4
|
my $data = $self->get; |
312
|
|
|
|
|
|
|
|
313
|
1
|
|
|
|
|
9
|
return $data - ($arg + 0); |
314
|
|
|
|
|
|
|
} |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
sub substr { |
317
|
4
|
|
|
4
|
1
|
19
|
my ($self, $offset, $length, $replace) = @_; |
318
|
|
|
|
|
|
|
|
319
|
4
|
|
|
|
|
12
|
my $data = $self->get; |
320
|
|
|
|
|
|
|
|
321
|
4
|
100
|
|
|
|
21
|
if (CORE::defined($replace)) { |
322
|
2
|
|
50
|
|
|
23
|
my $result = CORE::substr($data, $offset // 0, $length // 0, $replace); |
|
|
|
50
|
|
|
|
|
323
|
2
|
100
|
|
|
|
44
|
return wantarray ? ($result, $data) : $data; |
324
|
|
|
|
|
|
|
} |
325
|
|
|
|
|
|
|
else { |
326
|
2
|
|
50
|
|
|
21
|
my $result = CORE::substr($data, $offset // 0, $length // 0); |
|
|
|
50
|
|
|
|
|
327
|
2
|
50
|
|
|
|
15
|
return wantarray ? ($result, $data) : $result; |
328
|
|
|
|
|
|
|
} |
329
|
|
|
|
|
|
|
} |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
1; |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
=head1 NAME |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
Venus::Number - Number Class |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
=cut |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
=head1 ABSTRACT |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
Number Class for Perl 5 |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
=cut |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
=head1 SYNOPSIS |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
package main; |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
use Venus::Number; |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
my $number = Venus::Number->new(1_000); |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
# $number->abs; |
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
=cut |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
=head1 DESCRIPTION |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
This package provides methods for manipulating number data. |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
=cut |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
=head1 INHERITS |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
This package inherits behaviors from: |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
L |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
=cut |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
=head1 METHODS |
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
This package provides the following methods: |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
=cut |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
=head2 abs |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
abs() (Num) |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
The abs method returns the absolute value of the number. |
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
I> |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
=over 4 |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
=item abs example 1 |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
# given: synopsis; |
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
my $abs = $number->abs; |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
# 1000 |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
=back |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
=over 4 |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
=item abs example 2 |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
package main; |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
use Venus::Number; |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
my $number = Venus::Number->new(12); |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
my $abs = $number->abs; |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
# 12 |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
=back |
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
=over 4 |
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
=item abs example 3 |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
package main; |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
use Venus::Number; |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
my $number = Venus::Number->new(-12); |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
my $abs = $number->abs; |
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
# 12 |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
=back |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
=cut |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
=head2 add |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
add(Num $value) (Num) |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
The add method returns the result of addition performed on the argument |
438
|
|
|
|
|
|
|
provided. |
439
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
I> |
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
=over 4 |
443
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
=item add example 1 |
445
|
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
# given: synopsis; |
447
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
my $add = $number->add(1_000); |
449
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
# 2000 |
451
|
|
|
|
|
|
|
|
452
|
|
|
|
|
|
|
=back |
453
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
=cut |
455
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
=head2 append |
457
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
append(string @parts) (string) |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
The append method appends arugments to the number. |
461
|
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
I> |
463
|
|
|
|
|
|
|
|
464
|
|
|
|
|
|
|
=over 4 |
465
|
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
=item append example 1 |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
# given: synopsis; |
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
my $append = $number->append(0); |
471
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
# 10_000 |
473
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
=back |
475
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
=cut |
477
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
=head2 append_with |
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
append_with(string $delimiter, string @parts) (string) |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
The append_with method appends arugments to the number using the delimiter |
483
|
|
|
|
|
|
|
provided. |
484
|
|
|
|
|
|
|
|
485
|
|
|
|
|
|
|
I> |
486
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
=over 4 |
488
|
|
|
|
|
|
|
|
489
|
|
|
|
|
|
|
=item append_with example 1 |
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
# given: synopsis; |
492
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
my $append = $number->append_with('.', 0); |
494
|
|
|
|
|
|
|
|
495
|
|
|
|
|
|
|
# "1000.0" |
496
|
|
|
|
|
|
|
|
497
|
|
|
|
|
|
|
=back |
498
|
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
=cut |
500
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
=head2 atan2 |
502
|
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
atan2() (Num) |
504
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
The atan2 method returns the arctangent of Y/X in the range -PI to PI. |
506
|
|
|
|
|
|
|
|
507
|
|
|
|
|
|
|
I> |
508
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
=over 4 |
510
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
=item atan2 example 1 |
512
|
|
|
|
|
|
|
|
513
|
|
|
|
|
|
|
package main; |
514
|
|
|
|
|
|
|
|
515
|
|
|
|
|
|
|
use Venus::Number; |
516
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
my $number = Venus::Number->new(1); |
518
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
my $atan2 = $number->atan2(1); |
520
|
|
|
|
|
|
|
|
521
|
|
|
|
|
|
|
# 0.785398163397448 |
522
|
|
|
|
|
|
|
|
523
|
|
|
|
|
|
|
=back |
524
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
=cut |
526
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
=head2 cast |
528
|
|
|
|
|
|
|
|
529
|
|
|
|
|
|
|
cast(string $kind) (object | undef) |
530
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
The cast method converts L<"value"|Venus::Kind::Value> objects between |
532
|
|
|
|
|
|
|
different I<"value"> object types, based on the name of the type provided. This |
533
|
|
|
|
|
|
|
method will return C if the invocant is not a L. |
534
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
I> |
536
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
=over 4 |
538
|
|
|
|
|
|
|
|
539
|
|
|
|
|
|
|
=item cast example 1 |
540
|
|
|
|
|
|
|
|
541
|
|
|
|
|
|
|
package main; |
542
|
|
|
|
|
|
|
|
543
|
|
|
|
|
|
|
use Venus::Number; |
544
|
|
|
|
|
|
|
|
545
|
|
|
|
|
|
|
my $number = Venus::Number->new; |
546
|
|
|
|
|
|
|
|
547
|
|
|
|
|
|
|
my $cast = $number->cast('array'); |
548
|
|
|
|
|
|
|
|
549
|
|
|
|
|
|
|
# bless({ value => [0] }, "Venus::Array") |
550
|
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
=back |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
=over 4 |
554
|
|
|
|
|
|
|
|
555
|
|
|
|
|
|
|
=item cast example 2 |
556
|
|
|
|
|
|
|
|
557
|
|
|
|
|
|
|
package main; |
558
|
|
|
|
|
|
|
|
559
|
|
|
|
|
|
|
use Venus::Number; |
560
|
|
|
|
|
|
|
|
561
|
|
|
|
|
|
|
my $number = Venus::Number->new; |
562
|
|
|
|
|
|
|
|
563
|
|
|
|
|
|
|
my $cast = $number->cast('boolean'); |
564
|
|
|
|
|
|
|
|
565
|
|
|
|
|
|
|
# bless({ value => 0 }, "Venus::Boolean") |
566
|
|
|
|
|
|
|
|
567
|
|
|
|
|
|
|
=back |
568
|
|
|
|
|
|
|
|
569
|
|
|
|
|
|
|
=over 4 |
570
|
|
|
|
|
|
|
|
571
|
|
|
|
|
|
|
=item cast example 3 |
572
|
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
package main; |
574
|
|
|
|
|
|
|
|
575
|
|
|
|
|
|
|
use Venus::Number; |
576
|
|
|
|
|
|
|
|
577
|
|
|
|
|
|
|
my $number = Venus::Number->new; |
578
|
|
|
|
|
|
|
|
579
|
|
|
|
|
|
|
my $cast = $number->cast('code'); |
580
|
|
|
|
|
|
|
|
581
|
|
|
|
|
|
|
# bless({ value => sub { ... } }, "Venus::Code") |
582
|
|
|
|
|
|
|
|
583
|
|
|
|
|
|
|
=back |
584
|
|
|
|
|
|
|
|
585
|
|
|
|
|
|
|
=over 4 |
586
|
|
|
|
|
|
|
|
587
|
|
|
|
|
|
|
=item cast example 4 |
588
|
|
|
|
|
|
|
|
589
|
|
|
|
|
|
|
package main; |
590
|
|
|
|
|
|
|
|
591
|
|
|
|
|
|
|
use Venus::Number; |
592
|
|
|
|
|
|
|
|
593
|
|
|
|
|
|
|
my $number = Venus::Number->new; |
594
|
|
|
|
|
|
|
|
595
|
|
|
|
|
|
|
my $cast = $number->cast('float'); |
596
|
|
|
|
|
|
|
|
597
|
|
|
|
|
|
|
# bless({ value => "0.0" }, "Venus::Float") |
598
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
=back |
600
|
|
|
|
|
|
|
|
601
|
|
|
|
|
|
|
=over 4 |
602
|
|
|
|
|
|
|
|
603
|
|
|
|
|
|
|
=item cast example 5 |
604
|
|
|
|
|
|
|
|
605
|
|
|
|
|
|
|
package main; |
606
|
|
|
|
|
|
|
|
607
|
|
|
|
|
|
|
use Venus::Number; |
608
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
my $number = Venus::Number->new; |
610
|
|
|
|
|
|
|
|
611
|
|
|
|
|
|
|
my $cast = $number->cast('hash'); |
612
|
|
|
|
|
|
|
|
613
|
|
|
|
|
|
|
# bless({ value => { "0" => 0 } }, "Venus::Hash") |
614
|
|
|
|
|
|
|
|
615
|
|
|
|
|
|
|
=back |
616
|
|
|
|
|
|
|
|
617
|
|
|
|
|
|
|
=over 4 |
618
|
|
|
|
|
|
|
|
619
|
|
|
|
|
|
|
=item cast example 6 |
620
|
|
|
|
|
|
|
|
621
|
|
|
|
|
|
|
package main; |
622
|
|
|
|
|
|
|
|
623
|
|
|
|
|
|
|
use Venus::Number; |
624
|
|
|
|
|
|
|
|
625
|
|
|
|
|
|
|
my $number = Venus::Number->new; |
626
|
|
|
|
|
|
|
|
627
|
|
|
|
|
|
|
my $cast = $number->cast('number'); |
628
|
|
|
|
|
|
|
|
629
|
|
|
|
|
|
|
# bless({ value => 0 }, "Venus::Number") |
630
|
|
|
|
|
|
|
|
631
|
|
|
|
|
|
|
=back |
632
|
|
|
|
|
|
|
|
633
|
|
|
|
|
|
|
=over 4 |
634
|
|
|
|
|
|
|
|
635
|
|
|
|
|
|
|
=item cast example 7 |
636
|
|
|
|
|
|
|
|
637
|
|
|
|
|
|
|
package main; |
638
|
|
|
|
|
|
|
|
639
|
|
|
|
|
|
|
use Venus::Number; |
640
|
|
|
|
|
|
|
|
641
|
|
|
|
|
|
|
my $number = Venus::Number->new; |
642
|
|
|
|
|
|
|
|
643
|
|
|
|
|
|
|
my $cast = $number->cast('regexp'); |
644
|
|
|
|
|
|
|
|
645
|
|
|
|
|
|
|
# bless({ value => qr/(?^u:0)/ }, "Venus::Regexp") |
646
|
|
|
|
|
|
|
|
647
|
|
|
|
|
|
|
=back |
648
|
|
|
|
|
|
|
|
649
|
|
|
|
|
|
|
=over 4 |
650
|
|
|
|
|
|
|
|
651
|
|
|
|
|
|
|
=item cast example 8 |
652
|
|
|
|
|
|
|
|
653
|
|
|
|
|
|
|
package main; |
654
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
use Venus::Number; |
656
|
|
|
|
|
|
|
|
657
|
|
|
|
|
|
|
my $number = Venus::Number->new; |
658
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
my $cast = $number->cast('scalar'); |
660
|
|
|
|
|
|
|
|
661
|
|
|
|
|
|
|
# bless({ value => \0 }, "Venus::Scalar") |
662
|
|
|
|
|
|
|
|
663
|
|
|
|
|
|
|
=back |
664
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
=over 4 |
666
|
|
|
|
|
|
|
|
667
|
|
|
|
|
|
|
=item cast example 9 |
668
|
|
|
|
|
|
|
|
669
|
|
|
|
|
|
|
package main; |
670
|
|
|
|
|
|
|
|
671
|
|
|
|
|
|
|
use Venus::Number; |
672
|
|
|
|
|
|
|
|
673
|
|
|
|
|
|
|
my $number = Venus::Number->new; |
674
|
|
|
|
|
|
|
|
675
|
|
|
|
|
|
|
my $cast = $number->cast('string'); |
676
|
|
|
|
|
|
|
|
677
|
|
|
|
|
|
|
# bless({ value => 0 }, "Venus::String") |
678
|
|
|
|
|
|
|
|
679
|
|
|
|
|
|
|
=back |
680
|
|
|
|
|
|
|
|
681
|
|
|
|
|
|
|
=over 4 |
682
|
|
|
|
|
|
|
|
683
|
|
|
|
|
|
|
=item cast example 10 |
684
|
|
|
|
|
|
|
|
685
|
|
|
|
|
|
|
package main; |
686
|
|
|
|
|
|
|
|
687
|
|
|
|
|
|
|
use Venus::Number; |
688
|
|
|
|
|
|
|
|
689
|
|
|
|
|
|
|
my $number = Venus::Number->new; |
690
|
|
|
|
|
|
|
|
691
|
|
|
|
|
|
|
my $cast = $number->cast('undef'); |
692
|
|
|
|
|
|
|
|
693
|
|
|
|
|
|
|
# bless({ value => undef }, "Venus::Undef") |
694
|
|
|
|
|
|
|
|
695
|
|
|
|
|
|
|
=back |
696
|
|
|
|
|
|
|
|
697
|
|
|
|
|
|
|
=cut |
698
|
|
|
|
|
|
|
|
699
|
|
|
|
|
|
|
=head2 concat |
700
|
|
|
|
|
|
|
|
701
|
|
|
|
|
|
|
concat(string @parts) (string) |
702
|
|
|
|
|
|
|
|
703
|
|
|
|
|
|
|
The concat method returns the number with the argument list appended to it. |
704
|
|
|
|
|
|
|
|
705
|
|
|
|
|
|
|
I> |
706
|
|
|
|
|
|
|
|
707
|
|
|
|
|
|
|
=over 4 |
708
|
|
|
|
|
|
|
|
709
|
|
|
|
|
|
|
=item concat example 1 |
710
|
|
|
|
|
|
|
|
711
|
|
|
|
|
|
|
package main; |
712
|
|
|
|
|
|
|
|
713
|
|
|
|
|
|
|
use Venus::Number; |
714
|
|
|
|
|
|
|
|
715
|
|
|
|
|
|
|
my $number = Venus::Number->new(1_000); |
716
|
|
|
|
|
|
|
|
717
|
|
|
|
|
|
|
my $concat = $number->concat('.', '0001'); |
718
|
|
|
|
|
|
|
|
719
|
|
|
|
|
|
|
# "1000.0001" |
720
|
|
|
|
|
|
|
|
721
|
|
|
|
|
|
|
=back |
722
|
|
|
|
|
|
|
|
723
|
|
|
|
|
|
|
=cut |
724
|
|
|
|
|
|
|
|
725
|
|
|
|
|
|
|
=head2 contains |
726
|
|
|
|
|
|
|
|
727
|
|
|
|
|
|
|
contains(string $expr) (boolean) |
728
|
|
|
|
|
|
|
|
729
|
|
|
|
|
|
|
The contains method searches the number for a substring or expression returns |
730
|
|
|
|
|
|
|
true or false if found. |
731
|
|
|
|
|
|
|
|
732
|
|
|
|
|
|
|
I> |
733
|
|
|
|
|
|
|
|
734
|
|
|
|
|
|
|
=over 4 |
735
|
|
|
|
|
|
|
|
736
|
|
|
|
|
|
|
=item contains example 1 |
737
|
|
|
|
|
|
|
|
738
|
|
|
|
|
|
|
package main; |
739
|
|
|
|
|
|
|
|
740
|
|
|
|
|
|
|
use Venus::Number; |
741
|
|
|
|
|
|
|
|
742
|
|
|
|
|
|
|
my $number = Venus::Number->new(1_0001); |
743
|
|
|
|
|
|
|
|
744
|
|
|
|
|
|
|
my $contains = $number->contains(10); |
745
|
|
|
|
|
|
|
|
746
|
|
|
|
|
|
|
# 1 |
747
|
|
|
|
|
|
|
|
748
|
|
|
|
|
|
|
=back |
749
|
|
|
|
|
|
|
|
750
|
|
|
|
|
|
|
=over 4 |
751
|
|
|
|
|
|
|
|
752
|
|
|
|
|
|
|
=item contains example 2 |
753
|
|
|
|
|
|
|
|
754
|
|
|
|
|
|
|
package main; |
755
|
|
|
|
|
|
|
|
756
|
|
|
|
|
|
|
use Venus::Number; |
757
|
|
|
|
|
|
|
|
758
|
|
|
|
|
|
|
my $number = Venus::Number->new(1_0001); |
759
|
|
|
|
|
|
|
|
760
|
|
|
|
|
|
|
my $contains = $number->contains(2); |
761
|
|
|
|
|
|
|
|
762
|
|
|
|
|
|
|
# 0 |
763
|
|
|
|
|
|
|
|
764
|
|
|
|
|
|
|
=back |
765
|
|
|
|
|
|
|
|
766
|
|
|
|
|
|
|
=over 4 |
767
|
|
|
|
|
|
|
|
768
|
|
|
|
|
|
|
=item contains example 3 |
769
|
|
|
|
|
|
|
|
770
|
|
|
|
|
|
|
package main; |
771
|
|
|
|
|
|
|
|
772
|
|
|
|
|
|
|
use Venus::Number; |
773
|
|
|
|
|
|
|
|
774
|
|
|
|
|
|
|
my $number = Venus::Number->new(1_0001); |
775
|
|
|
|
|
|
|
|
776
|
|
|
|
|
|
|
my $contains = $number->contains(qr/01$/); |
777
|
|
|
|
|
|
|
|
778
|
|
|
|
|
|
|
# 1 |
779
|
|
|
|
|
|
|
|
780
|
|
|
|
|
|
|
=back |
781
|
|
|
|
|
|
|
|
782
|
|
|
|
|
|
|
=cut |
783
|
|
|
|
|
|
|
|
784
|
|
|
|
|
|
|
=head2 cos |
785
|
|
|
|
|
|
|
|
786
|
|
|
|
|
|
|
cos() (Num) |
787
|
|
|
|
|
|
|
|
788
|
|
|
|
|
|
|
The cos method computes the cosine of the number (expressed in radians). |
789
|
|
|
|
|
|
|
|
790
|
|
|
|
|
|
|
I> |
791
|
|
|
|
|
|
|
|
792
|
|
|
|
|
|
|
=over 4 |
793
|
|
|
|
|
|
|
|
794
|
|
|
|
|
|
|
=item cos example 1 |
795
|
|
|
|
|
|
|
|
796
|
|
|
|
|
|
|
package main; |
797
|
|
|
|
|
|
|
|
798
|
|
|
|
|
|
|
use Venus::Number; |
799
|
|
|
|
|
|
|
|
800
|
|
|
|
|
|
|
my $number = Venus::Number->new(12); |
801
|
|
|
|
|
|
|
|
802
|
|
|
|
|
|
|
my $cos = $number->cos; |
803
|
|
|
|
|
|
|
|
804
|
|
|
|
|
|
|
# 0.843853958732492 |
805
|
|
|
|
|
|
|
|
806
|
|
|
|
|
|
|
=back |
807
|
|
|
|
|
|
|
|
808
|
|
|
|
|
|
|
=cut |
809
|
|
|
|
|
|
|
|
810
|
|
|
|
|
|
|
=head2 decr |
811
|
|
|
|
|
|
|
|
812
|
|
|
|
|
|
|
decr() (Num) |
813
|
|
|
|
|
|
|
|
814
|
|
|
|
|
|
|
The decr method returns the numeric number decremented by 1. |
815
|
|
|
|
|
|
|
|
816
|
|
|
|
|
|
|
I> |
817
|
|
|
|
|
|
|
|
818
|
|
|
|
|
|
|
=over 4 |
819
|
|
|
|
|
|
|
|
820
|
|
|
|
|
|
|
=item decr example 1 |
821
|
|
|
|
|
|
|
|
822
|
|
|
|
|
|
|
package main; |
823
|
|
|
|
|
|
|
|
824
|
|
|
|
|
|
|
use Venus::Number; |
825
|
|
|
|
|
|
|
|
826
|
|
|
|
|
|
|
my $number = Venus::Number->new(123456789); |
827
|
|
|
|
|
|
|
|
828
|
|
|
|
|
|
|
my $decr = $number->decr; |
829
|
|
|
|
|
|
|
|
830
|
|
|
|
|
|
|
# 123456788 |
831
|
|
|
|
|
|
|
|
832
|
|
|
|
|
|
|
=back |
833
|
|
|
|
|
|
|
|
834
|
|
|
|
|
|
|
=over 4 |
835
|
|
|
|
|
|
|
|
836
|
|
|
|
|
|
|
=item decr example 2 |
837
|
|
|
|
|
|
|
|
838
|
|
|
|
|
|
|
package main; |
839
|
|
|
|
|
|
|
|
840
|
|
|
|
|
|
|
use Venus::Number; |
841
|
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
my $number = Venus::Number->new(123456789); |
843
|
|
|
|
|
|
|
|
844
|
|
|
|
|
|
|
my $decr = $number->decr(123456788); |
845
|
|
|
|
|
|
|
|
846
|
|
|
|
|
|
|
# 1 |
847
|
|
|
|
|
|
|
|
848
|
|
|
|
|
|
|
=back |
849
|
|
|
|
|
|
|
|
850
|
|
|
|
|
|
|
=cut |
851
|
|
|
|
|
|
|
|
852
|
|
|
|
|
|
|
=head2 default |
853
|
|
|
|
|
|
|
|
854
|
|
|
|
|
|
|
default() (Num) |
855
|
|
|
|
|
|
|
|
856
|
|
|
|
|
|
|
The default method returns the default value, i.e. C<0>. |
857
|
|
|
|
|
|
|
|
858
|
|
|
|
|
|
|
I> |
859
|
|
|
|
|
|
|
|
860
|
|
|
|
|
|
|
=over 4 |
861
|
|
|
|
|
|
|
|
862
|
|
|
|
|
|
|
=item default example 1 |
863
|
|
|
|
|
|
|
|
864
|
|
|
|
|
|
|
# given: synopsis; |
865
|
|
|
|
|
|
|
|
866
|
|
|
|
|
|
|
my $default = $number->default; |
867
|
|
|
|
|
|
|
|
868
|
|
|
|
|
|
|
# 0 |
869
|
|
|
|
|
|
|
|
870
|
|
|
|
|
|
|
=back |
871
|
|
|
|
|
|
|
|
872
|
|
|
|
|
|
|
=cut |
873
|
|
|
|
|
|
|
|
874
|
|
|
|
|
|
|
=head2 div |
875
|
|
|
|
|
|
|
|
876
|
|
|
|
|
|
|
div(Num $value) (Num) |
877
|
|
|
|
|
|
|
|
878
|
|
|
|
|
|
|
The div method returns the result of division performed on the argument |
879
|
|
|
|
|
|
|
provided. |
880
|
|
|
|
|
|
|
|
881
|
|
|
|
|
|
|
I> |
882
|
|
|
|
|
|
|
|
883
|
|
|
|
|
|
|
=over 4 |
884
|
|
|
|
|
|
|
|
885
|
|
|
|
|
|
|
=item div example 1 |
886
|
|
|
|
|
|
|
|
887
|
|
|
|
|
|
|
# given: synopsis; |
888
|
|
|
|
|
|
|
|
889
|
|
|
|
|
|
|
my $div = $number->div(2); |
890
|
|
|
|
|
|
|
|
891
|
|
|
|
|
|
|
# 500 |
892
|
|
|
|
|
|
|
|
893
|
|
|
|
|
|
|
=back |
894
|
|
|
|
|
|
|
|
895
|
|
|
|
|
|
|
=cut |
896
|
|
|
|
|
|
|
|
897
|
|
|
|
|
|
|
=head2 eq |
898
|
|
|
|
|
|
|
|
899
|
|
|
|
|
|
|
eq(any $arg) (boolean) |
900
|
|
|
|
|
|
|
|
901
|
|
|
|
|
|
|
The eq method performs an I<"equals"> operation using the argument provided. |
902
|
|
|
|
|
|
|
|
903
|
|
|
|
|
|
|
I> |
904
|
|
|
|
|
|
|
|
905
|
|
|
|
|
|
|
=over 4 |
906
|
|
|
|
|
|
|
|
907
|
|
|
|
|
|
|
=item eq example 1 |
908
|
|
|
|
|
|
|
|
909
|
|
|
|
|
|
|
package main; |
910
|
|
|
|
|
|
|
|
911
|
|
|
|
|
|
|
use Venus::Array; |
912
|
|
|
|
|
|
|
use Venus::Number; |
913
|
|
|
|
|
|
|
|
914
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
915
|
|
|
|
|
|
|
my $rvalue = Venus::Array->new; |
916
|
|
|
|
|
|
|
|
917
|
|
|
|
|
|
|
my $result = $lvalue->eq($rvalue); |
918
|
|
|
|
|
|
|
|
919
|
|
|
|
|
|
|
# 0 |
920
|
|
|
|
|
|
|
|
921
|
|
|
|
|
|
|
=back |
922
|
|
|
|
|
|
|
|
923
|
|
|
|
|
|
|
=over 4 |
924
|
|
|
|
|
|
|
|
925
|
|
|
|
|
|
|
=item eq example 2 |
926
|
|
|
|
|
|
|
|
927
|
|
|
|
|
|
|
package main; |
928
|
|
|
|
|
|
|
|
929
|
|
|
|
|
|
|
use Venus::Code; |
930
|
|
|
|
|
|
|
use Venus::Number; |
931
|
|
|
|
|
|
|
|
932
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
933
|
|
|
|
|
|
|
my $rvalue = Venus::Code->new; |
934
|
|
|
|
|
|
|
|
935
|
|
|
|
|
|
|
my $result = $lvalue->eq($rvalue); |
936
|
|
|
|
|
|
|
|
937
|
|
|
|
|
|
|
# 0 |
938
|
|
|
|
|
|
|
|
939
|
|
|
|
|
|
|
=back |
940
|
|
|
|
|
|
|
|
941
|
|
|
|
|
|
|
=over 4 |
942
|
|
|
|
|
|
|
|
943
|
|
|
|
|
|
|
=item eq example 3 |
944
|
|
|
|
|
|
|
|
945
|
|
|
|
|
|
|
package main; |
946
|
|
|
|
|
|
|
|
947
|
|
|
|
|
|
|
use Venus::Float; |
948
|
|
|
|
|
|
|
use Venus::Number; |
949
|
|
|
|
|
|
|
|
950
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
951
|
|
|
|
|
|
|
my $rvalue = Venus::Float->new; |
952
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
my $result = $lvalue->eq($rvalue); |
954
|
|
|
|
|
|
|
|
955
|
|
|
|
|
|
|
# 1 |
956
|
|
|
|
|
|
|
|
957
|
|
|
|
|
|
|
=back |
958
|
|
|
|
|
|
|
|
959
|
|
|
|
|
|
|
=over 4 |
960
|
|
|
|
|
|
|
|
961
|
|
|
|
|
|
|
=item eq example 4 |
962
|
|
|
|
|
|
|
|
963
|
|
|
|
|
|
|
package main; |
964
|
|
|
|
|
|
|
|
965
|
|
|
|
|
|
|
use Venus::Hash; |
966
|
|
|
|
|
|
|
use Venus::Number; |
967
|
|
|
|
|
|
|
|
968
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
969
|
|
|
|
|
|
|
my $rvalue = Venus::Hash->new; |
970
|
|
|
|
|
|
|
|
971
|
|
|
|
|
|
|
my $result = $lvalue->eq($rvalue); |
972
|
|
|
|
|
|
|
|
973
|
|
|
|
|
|
|
# 0 |
974
|
|
|
|
|
|
|
|
975
|
|
|
|
|
|
|
=back |
976
|
|
|
|
|
|
|
|
977
|
|
|
|
|
|
|
=over 4 |
978
|
|
|
|
|
|
|
|
979
|
|
|
|
|
|
|
=item eq example 5 |
980
|
|
|
|
|
|
|
|
981
|
|
|
|
|
|
|
package main; |
982
|
|
|
|
|
|
|
|
983
|
|
|
|
|
|
|
use Venus::Number; |
984
|
|
|
|
|
|
|
|
985
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
986
|
|
|
|
|
|
|
my $rvalue = Venus::Number->new; |
987
|
|
|
|
|
|
|
|
988
|
|
|
|
|
|
|
my $result = $lvalue->eq($rvalue); |
989
|
|
|
|
|
|
|
|
990
|
|
|
|
|
|
|
# 1 |
991
|
|
|
|
|
|
|
|
992
|
|
|
|
|
|
|
=back |
993
|
|
|
|
|
|
|
|
994
|
|
|
|
|
|
|
=over 4 |
995
|
|
|
|
|
|
|
|
996
|
|
|
|
|
|
|
=item eq example 6 |
997
|
|
|
|
|
|
|
|
998
|
|
|
|
|
|
|
package main; |
999
|
|
|
|
|
|
|
|
1000
|
|
|
|
|
|
|
use Venus::Number; |
1001
|
|
|
|
|
|
|
use Venus::Regexp; |
1002
|
|
|
|
|
|
|
|
1003
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1004
|
|
|
|
|
|
|
my $rvalue = Venus::Regexp->new; |
1005
|
|
|
|
|
|
|
|
1006
|
|
|
|
|
|
|
my $result = $lvalue->eq($rvalue); |
1007
|
|
|
|
|
|
|
|
1008
|
|
|
|
|
|
|
# 0 |
1009
|
|
|
|
|
|
|
|
1010
|
|
|
|
|
|
|
=back |
1011
|
|
|
|
|
|
|
|
1012
|
|
|
|
|
|
|
=over 4 |
1013
|
|
|
|
|
|
|
|
1014
|
|
|
|
|
|
|
=item eq example 7 |
1015
|
|
|
|
|
|
|
|
1016
|
|
|
|
|
|
|
package main; |
1017
|
|
|
|
|
|
|
|
1018
|
|
|
|
|
|
|
use Venus::Number; |
1019
|
|
|
|
|
|
|
use Venus::Scalar; |
1020
|
|
|
|
|
|
|
|
1021
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1022
|
|
|
|
|
|
|
my $rvalue = Venus::Scalar->new; |
1023
|
|
|
|
|
|
|
|
1024
|
|
|
|
|
|
|
my $result = $lvalue->eq($rvalue); |
1025
|
|
|
|
|
|
|
|
1026
|
|
|
|
|
|
|
# 0 |
1027
|
|
|
|
|
|
|
|
1028
|
|
|
|
|
|
|
=back |
1029
|
|
|
|
|
|
|
|
1030
|
|
|
|
|
|
|
=over 4 |
1031
|
|
|
|
|
|
|
|
1032
|
|
|
|
|
|
|
=item eq example 8 |
1033
|
|
|
|
|
|
|
|
1034
|
|
|
|
|
|
|
package main; |
1035
|
|
|
|
|
|
|
|
1036
|
|
|
|
|
|
|
use Venus::Number; |
1037
|
|
|
|
|
|
|
use Venus::String; |
1038
|
|
|
|
|
|
|
|
1039
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1040
|
|
|
|
|
|
|
my $rvalue = Venus::String->new; |
1041
|
|
|
|
|
|
|
|
1042
|
|
|
|
|
|
|
my $result = $lvalue->eq($rvalue); |
1043
|
|
|
|
|
|
|
|
1044
|
|
|
|
|
|
|
# 1 |
1045
|
|
|
|
|
|
|
|
1046
|
|
|
|
|
|
|
=back |
1047
|
|
|
|
|
|
|
|
1048
|
|
|
|
|
|
|
=over 4 |
1049
|
|
|
|
|
|
|
|
1050
|
|
|
|
|
|
|
=item eq example 9 |
1051
|
|
|
|
|
|
|
|
1052
|
|
|
|
|
|
|
package main; |
1053
|
|
|
|
|
|
|
|
1054
|
|
|
|
|
|
|
use Venus::Number; |
1055
|
|
|
|
|
|
|
use Venus::Undef; |
1056
|
|
|
|
|
|
|
|
1057
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1058
|
|
|
|
|
|
|
my $rvalue = Venus::Undef->new; |
1059
|
|
|
|
|
|
|
|
1060
|
|
|
|
|
|
|
my $result = $lvalue->eq($rvalue); |
1061
|
|
|
|
|
|
|
|
1062
|
|
|
|
|
|
|
# 1 |
1063
|
|
|
|
|
|
|
|
1064
|
|
|
|
|
|
|
=back |
1065
|
|
|
|
|
|
|
|
1066
|
|
|
|
|
|
|
=cut |
1067
|
|
|
|
|
|
|
|
1068
|
|
|
|
|
|
|
=head2 exp |
1069
|
|
|
|
|
|
|
|
1070
|
|
|
|
|
|
|
exp() (Num) |
1071
|
|
|
|
|
|
|
|
1072
|
|
|
|
|
|
|
The exp method returns e (the natural logarithm base) to the power of the |
1073
|
|
|
|
|
|
|
number. |
1074
|
|
|
|
|
|
|
|
1075
|
|
|
|
|
|
|
I> |
1076
|
|
|
|
|
|
|
|
1077
|
|
|
|
|
|
|
=over 4 |
1078
|
|
|
|
|
|
|
|
1079
|
|
|
|
|
|
|
=item exp example 1 |
1080
|
|
|
|
|
|
|
|
1081
|
|
|
|
|
|
|
package main; |
1082
|
|
|
|
|
|
|
|
1083
|
|
|
|
|
|
|
use Venus::Number; |
1084
|
|
|
|
|
|
|
|
1085
|
|
|
|
|
|
|
my $number = Venus::Number->new(0); |
1086
|
|
|
|
|
|
|
|
1087
|
|
|
|
|
|
|
my $exp = $number->exp; |
1088
|
|
|
|
|
|
|
|
1089
|
|
|
|
|
|
|
# 1 |
1090
|
|
|
|
|
|
|
|
1091
|
|
|
|
|
|
|
=back |
1092
|
|
|
|
|
|
|
|
1093
|
|
|
|
|
|
|
=over 4 |
1094
|
|
|
|
|
|
|
|
1095
|
|
|
|
|
|
|
=item exp example 2 |
1096
|
|
|
|
|
|
|
|
1097
|
|
|
|
|
|
|
package main; |
1098
|
|
|
|
|
|
|
|
1099
|
|
|
|
|
|
|
use Venus::Number; |
1100
|
|
|
|
|
|
|
|
1101
|
|
|
|
|
|
|
my $number = Venus::Number->new(1); |
1102
|
|
|
|
|
|
|
|
1103
|
|
|
|
|
|
|
my $exp = $number->exp; |
1104
|
|
|
|
|
|
|
|
1105
|
|
|
|
|
|
|
# 2.71828182845905 |
1106
|
|
|
|
|
|
|
|
1107
|
|
|
|
|
|
|
=back |
1108
|
|
|
|
|
|
|
|
1109
|
|
|
|
|
|
|
=over 4 |
1110
|
|
|
|
|
|
|
|
1111
|
|
|
|
|
|
|
=item exp example 3 |
1112
|
|
|
|
|
|
|
|
1113
|
|
|
|
|
|
|
package main; |
1114
|
|
|
|
|
|
|
|
1115
|
|
|
|
|
|
|
use Venus::Number; |
1116
|
|
|
|
|
|
|
|
1117
|
|
|
|
|
|
|
my $number = Venus::Number->new(1.5); |
1118
|
|
|
|
|
|
|
|
1119
|
|
|
|
|
|
|
my $exp = $number->exp; |
1120
|
|
|
|
|
|
|
|
1121
|
|
|
|
|
|
|
# 4.48168907033806 |
1122
|
|
|
|
|
|
|
|
1123
|
|
|
|
|
|
|
=back |
1124
|
|
|
|
|
|
|
|
1125
|
|
|
|
|
|
|
=cut |
1126
|
|
|
|
|
|
|
|
1127
|
|
|
|
|
|
|
=head2 ge |
1128
|
|
|
|
|
|
|
|
1129
|
|
|
|
|
|
|
ge(any $arg) (boolean) |
1130
|
|
|
|
|
|
|
|
1131
|
|
|
|
|
|
|
The ge method performs a I<"greater-than-or-equal-to"> operation using the |
1132
|
|
|
|
|
|
|
argument provided. |
1133
|
|
|
|
|
|
|
|
1134
|
|
|
|
|
|
|
I> |
1135
|
|
|
|
|
|
|
|
1136
|
|
|
|
|
|
|
=over 4 |
1137
|
|
|
|
|
|
|
|
1138
|
|
|
|
|
|
|
=item ge example 1 |
1139
|
|
|
|
|
|
|
|
1140
|
|
|
|
|
|
|
package main; |
1141
|
|
|
|
|
|
|
|
1142
|
|
|
|
|
|
|
use Venus::Array; |
1143
|
|
|
|
|
|
|
use Venus::Number; |
1144
|
|
|
|
|
|
|
|
1145
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1146
|
|
|
|
|
|
|
my $rvalue = Venus::Array->new; |
1147
|
|
|
|
|
|
|
|
1148
|
|
|
|
|
|
|
my $result = $lvalue->ge($rvalue); |
1149
|
|
|
|
|
|
|
|
1150
|
|
|
|
|
|
|
# 0 |
1151
|
|
|
|
|
|
|
|
1152
|
|
|
|
|
|
|
=back |
1153
|
|
|
|
|
|
|
|
1154
|
|
|
|
|
|
|
=over 4 |
1155
|
|
|
|
|
|
|
|
1156
|
|
|
|
|
|
|
=item ge example 2 |
1157
|
|
|
|
|
|
|
|
1158
|
|
|
|
|
|
|
package main; |
1159
|
|
|
|
|
|
|
|
1160
|
|
|
|
|
|
|
use Venus::Code; |
1161
|
|
|
|
|
|
|
use Venus::Number; |
1162
|
|
|
|
|
|
|
|
1163
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1164
|
|
|
|
|
|
|
my $rvalue = Venus::Code->new; |
1165
|
|
|
|
|
|
|
|
1166
|
|
|
|
|
|
|
my $result = $lvalue->ge($rvalue); |
1167
|
|
|
|
|
|
|
|
1168
|
|
|
|
|
|
|
# 0 |
1169
|
|
|
|
|
|
|
|
1170
|
|
|
|
|
|
|
=back |
1171
|
|
|
|
|
|
|
|
1172
|
|
|
|
|
|
|
=over 4 |
1173
|
|
|
|
|
|
|
|
1174
|
|
|
|
|
|
|
=item ge example 3 |
1175
|
|
|
|
|
|
|
|
1176
|
|
|
|
|
|
|
package main; |
1177
|
|
|
|
|
|
|
|
1178
|
|
|
|
|
|
|
use Venus::Float; |
1179
|
|
|
|
|
|
|
use Venus::Number; |
1180
|
|
|
|
|
|
|
|
1181
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1182
|
|
|
|
|
|
|
my $rvalue = Venus::Float->new; |
1183
|
|
|
|
|
|
|
|
1184
|
|
|
|
|
|
|
my $result = $lvalue->ge($rvalue); |
1185
|
|
|
|
|
|
|
|
1186
|
|
|
|
|
|
|
# 1 |
1187
|
|
|
|
|
|
|
|
1188
|
|
|
|
|
|
|
=back |
1189
|
|
|
|
|
|
|
|
1190
|
|
|
|
|
|
|
=over 4 |
1191
|
|
|
|
|
|
|
|
1192
|
|
|
|
|
|
|
=item ge example 4 |
1193
|
|
|
|
|
|
|
|
1194
|
|
|
|
|
|
|
package main; |
1195
|
|
|
|
|
|
|
|
1196
|
|
|
|
|
|
|
use Venus::Hash; |
1197
|
|
|
|
|
|
|
use Venus::Number; |
1198
|
|
|
|
|
|
|
|
1199
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1200
|
|
|
|
|
|
|
my $rvalue = Venus::Hash->new; |
1201
|
|
|
|
|
|
|
|
1202
|
|
|
|
|
|
|
my $result = $lvalue->ge($rvalue); |
1203
|
|
|
|
|
|
|
|
1204
|
|
|
|
|
|
|
# 0 |
1205
|
|
|
|
|
|
|
|
1206
|
|
|
|
|
|
|
=back |
1207
|
|
|
|
|
|
|
|
1208
|
|
|
|
|
|
|
=over 4 |
1209
|
|
|
|
|
|
|
|
1210
|
|
|
|
|
|
|
=item ge example 5 |
1211
|
|
|
|
|
|
|
|
1212
|
|
|
|
|
|
|
package main; |
1213
|
|
|
|
|
|
|
|
1214
|
|
|
|
|
|
|
use Venus::Number; |
1215
|
|
|
|
|
|
|
|
1216
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1217
|
|
|
|
|
|
|
my $rvalue = Venus::Number->new; |
1218
|
|
|
|
|
|
|
|
1219
|
|
|
|
|
|
|
my $result = $lvalue->ge($rvalue); |
1220
|
|
|
|
|
|
|
|
1221
|
|
|
|
|
|
|
# 1 |
1222
|
|
|
|
|
|
|
|
1223
|
|
|
|
|
|
|
=back |
1224
|
|
|
|
|
|
|
|
1225
|
|
|
|
|
|
|
=over 4 |
1226
|
|
|
|
|
|
|
|
1227
|
|
|
|
|
|
|
=item ge example 6 |
1228
|
|
|
|
|
|
|
|
1229
|
|
|
|
|
|
|
package main; |
1230
|
|
|
|
|
|
|
|
1231
|
|
|
|
|
|
|
use Venus::Number; |
1232
|
|
|
|
|
|
|
use Venus::Regexp; |
1233
|
|
|
|
|
|
|
|
1234
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1235
|
|
|
|
|
|
|
my $rvalue = Venus::Regexp->new; |
1236
|
|
|
|
|
|
|
|
1237
|
|
|
|
|
|
|
my $result = $lvalue->ge($rvalue); |
1238
|
|
|
|
|
|
|
|
1239
|
|
|
|
|
|
|
# 0 |
1240
|
|
|
|
|
|
|
|
1241
|
|
|
|
|
|
|
=back |
1242
|
|
|
|
|
|
|
|
1243
|
|
|
|
|
|
|
=over 4 |
1244
|
|
|
|
|
|
|
|
1245
|
|
|
|
|
|
|
=item ge example 7 |
1246
|
|
|
|
|
|
|
|
1247
|
|
|
|
|
|
|
package main; |
1248
|
|
|
|
|
|
|
|
1249
|
|
|
|
|
|
|
use Venus::Number; |
1250
|
|
|
|
|
|
|
use Venus::Scalar; |
1251
|
|
|
|
|
|
|
|
1252
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1253
|
|
|
|
|
|
|
my $rvalue = Venus::Scalar->new; |
1254
|
|
|
|
|
|
|
|
1255
|
|
|
|
|
|
|
my $result = $lvalue->ge($rvalue); |
1256
|
|
|
|
|
|
|
|
1257
|
|
|
|
|
|
|
# 0 |
1258
|
|
|
|
|
|
|
|
1259
|
|
|
|
|
|
|
=back |
1260
|
|
|
|
|
|
|
|
1261
|
|
|
|
|
|
|
=over 4 |
1262
|
|
|
|
|
|
|
|
1263
|
|
|
|
|
|
|
=item ge example 8 |
1264
|
|
|
|
|
|
|
|
1265
|
|
|
|
|
|
|
package main; |
1266
|
|
|
|
|
|
|
|
1267
|
|
|
|
|
|
|
use Venus::Number; |
1268
|
|
|
|
|
|
|
use Venus::String; |
1269
|
|
|
|
|
|
|
|
1270
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1271
|
|
|
|
|
|
|
my $rvalue = Venus::String->new; |
1272
|
|
|
|
|
|
|
|
1273
|
|
|
|
|
|
|
my $result = $lvalue->ge($rvalue); |
1274
|
|
|
|
|
|
|
|
1275
|
|
|
|
|
|
|
# 1 |
1276
|
|
|
|
|
|
|
|
1277
|
|
|
|
|
|
|
=back |
1278
|
|
|
|
|
|
|
|
1279
|
|
|
|
|
|
|
=over 4 |
1280
|
|
|
|
|
|
|
|
1281
|
|
|
|
|
|
|
=item ge example 9 |
1282
|
|
|
|
|
|
|
|
1283
|
|
|
|
|
|
|
package main; |
1284
|
|
|
|
|
|
|
|
1285
|
|
|
|
|
|
|
use Venus::Number; |
1286
|
|
|
|
|
|
|
use Venus::Undef; |
1287
|
|
|
|
|
|
|
|
1288
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1289
|
|
|
|
|
|
|
my $rvalue = Venus::Undef->new; |
1290
|
|
|
|
|
|
|
|
1291
|
|
|
|
|
|
|
my $result = $lvalue->ge($rvalue); |
1292
|
|
|
|
|
|
|
|
1293
|
|
|
|
|
|
|
# 1 |
1294
|
|
|
|
|
|
|
|
1295
|
|
|
|
|
|
|
=back |
1296
|
|
|
|
|
|
|
|
1297
|
|
|
|
|
|
|
=cut |
1298
|
|
|
|
|
|
|
|
1299
|
|
|
|
|
|
|
=head2 gele |
1300
|
|
|
|
|
|
|
|
1301
|
|
|
|
|
|
|
gele(any $arg1, any $arg2) (boolean) |
1302
|
|
|
|
|
|
|
|
1303
|
|
|
|
|
|
|
The gele method performs a I<"greater-than-or-equal-to"> operation on the 1st |
1304
|
|
|
|
|
|
|
argument, and I<"lesser-than-or-equal-to"> operation on the 2nd argument. |
1305
|
|
|
|
|
|
|
|
1306
|
|
|
|
|
|
|
I> |
1307
|
|
|
|
|
|
|
|
1308
|
|
|
|
|
|
|
=over 4 |
1309
|
|
|
|
|
|
|
|
1310
|
|
|
|
|
|
|
=item gele example 1 |
1311
|
|
|
|
|
|
|
|
1312
|
|
|
|
|
|
|
package main; |
1313
|
|
|
|
|
|
|
|
1314
|
|
|
|
|
|
|
use Venus::Array; |
1315
|
|
|
|
|
|
|
use Venus::Number; |
1316
|
|
|
|
|
|
|
|
1317
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1318
|
|
|
|
|
|
|
my $rvalue = Venus::Array->new; |
1319
|
|
|
|
|
|
|
|
1320
|
|
|
|
|
|
|
my $result = $lvalue->gele($rvalue); |
1321
|
|
|
|
|
|
|
|
1322
|
|
|
|
|
|
|
# 0 |
1323
|
|
|
|
|
|
|
|
1324
|
|
|
|
|
|
|
=back |
1325
|
|
|
|
|
|
|
|
1326
|
|
|
|
|
|
|
=over 4 |
1327
|
|
|
|
|
|
|
|
1328
|
|
|
|
|
|
|
=item gele example 2 |
1329
|
|
|
|
|
|
|
|
1330
|
|
|
|
|
|
|
package main; |
1331
|
|
|
|
|
|
|
|
1332
|
|
|
|
|
|
|
use Venus::Code; |
1333
|
|
|
|
|
|
|
use Venus::Number; |
1334
|
|
|
|
|
|
|
|
1335
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1336
|
|
|
|
|
|
|
my $rvalue = Venus::Code->new; |
1337
|
|
|
|
|
|
|
|
1338
|
|
|
|
|
|
|
my $result = $lvalue->gele($rvalue); |
1339
|
|
|
|
|
|
|
|
1340
|
|
|
|
|
|
|
# 0 |
1341
|
|
|
|
|
|
|
|
1342
|
|
|
|
|
|
|
=back |
1343
|
|
|
|
|
|
|
|
1344
|
|
|
|
|
|
|
=over 4 |
1345
|
|
|
|
|
|
|
|
1346
|
|
|
|
|
|
|
=item gele example 3 |
1347
|
|
|
|
|
|
|
|
1348
|
|
|
|
|
|
|
package main; |
1349
|
|
|
|
|
|
|
|
1350
|
|
|
|
|
|
|
use Venus::Float; |
1351
|
|
|
|
|
|
|
use Venus::Number; |
1352
|
|
|
|
|
|
|
|
1353
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1354
|
|
|
|
|
|
|
my $rvalue = Venus::Float->new; |
1355
|
|
|
|
|
|
|
|
1356
|
|
|
|
|
|
|
my $result = $lvalue->gele($rvalue); |
1357
|
|
|
|
|
|
|
|
1358
|
|
|
|
|
|
|
# 1 |
1359
|
|
|
|
|
|
|
|
1360
|
|
|
|
|
|
|
=back |
1361
|
|
|
|
|
|
|
|
1362
|
|
|
|
|
|
|
=over 4 |
1363
|
|
|
|
|
|
|
|
1364
|
|
|
|
|
|
|
=item gele example 4 |
1365
|
|
|
|
|
|
|
|
1366
|
|
|
|
|
|
|
package main; |
1367
|
|
|
|
|
|
|
|
1368
|
|
|
|
|
|
|
use Venus::Hash; |
1369
|
|
|
|
|
|
|
use Venus::Number; |
1370
|
|
|
|
|
|
|
|
1371
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1372
|
|
|
|
|
|
|
my $rvalue = Venus::Hash->new; |
1373
|
|
|
|
|
|
|
|
1374
|
|
|
|
|
|
|
my $result = $lvalue->gele($rvalue); |
1375
|
|
|
|
|
|
|
|
1376
|
|
|
|
|
|
|
# 0 |
1377
|
|
|
|
|
|
|
|
1378
|
|
|
|
|
|
|
=back |
1379
|
|
|
|
|
|
|
|
1380
|
|
|
|
|
|
|
=over 4 |
1381
|
|
|
|
|
|
|
|
1382
|
|
|
|
|
|
|
=item gele example 5 |
1383
|
|
|
|
|
|
|
|
1384
|
|
|
|
|
|
|
package main; |
1385
|
|
|
|
|
|
|
|
1386
|
|
|
|
|
|
|
use Venus::Number; |
1387
|
|
|
|
|
|
|
|
1388
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1389
|
|
|
|
|
|
|
my $rvalue = Venus::Number->new; |
1390
|
|
|
|
|
|
|
|
1391
|
|
|
|
|
|
|
my $result = $lvalue->gele($rvalue); |
1392
|
|
|
|
|
|
|
|
1393
|
|
|
|
|
|
|
# 1 |
1394
|
|
|
|
|
|
|
|
1395
|
|
|
|
|
|
|
=back |
1396
|
|
|
|
|
|
|
|
1397
|
|
|
|
|
|
|
=over 4 |
1398
|
|
|
|
|
|
|
|
1399
|
|
|
|
|
|
|
=item gele example 6 |
1400
|
|
|
|
|
|
|
|
1401
|
|
|
|
|
|
|
package main; |
1402
|
|
|
|
|
|
|
|
1403
|
|
|
|
|
|
|
use Venus::Number; |
1404
|
|
|
|
|
|
|
use Venus::Regexp; |
1405
|
|
|
|
|
|
|
|
1406
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1407
|
|
|
|
|
|
|
my $rvalue = Venus::Regexp->new; |
1408
|
|
|
|
|
|
|
|
1409
|
|
|
|
|
|
|
my $result = $lvalue->gele($rvalue); |
1410
|
|
|
|
|
|
|
|
1411
|
|
|
|
|
|
|
# 0 |
1412
|
|
|
|
|
|
|
|
1413
|
|
|
|
|
|
|
=back |
1414
|
|
|
|
|
|
|
|
1415
|
|
|
|
|
|
|
=over 4 |
1416
|
|
|
|
|
|
|
|
1417
|
|
|
|
|
|
|
=item gele example 7 |
1418
|
|
|
|
|
|
|
|
1419
|
|
|
|
|
|
|
package main; |
1420
|
|
|
|
|
|
|
|
1421
|
|
|
|
|
|
|
use Venus::Number; |
1422
|
|
|
|
|
|
|
use Venus::Scalar; |
1423
|
|
|
|
|
|
|
|
1424
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1425
|
|
|
|
|
|
|
my $rvalue = Venus::Scalar->new; |
1426
|
|
|
|
|
|
|
|
1427
|
|
|
|
|
|
|
my $result = $lvalue->gele($rvalue); |
1428
|
|
|
|
|
|
|
|
1429
|
|
|
|
|
|
|
# 0 |
1430
|
|
|
|
|
|
|
|
1431
|
|
|
|
|
|
|
=back |
1432
|
|
|
|
|
|
|
|
1433
|
|
|
|
|
|
|
=over 4 |
1434
|
|
|
|
|
|
|
|
1435
|
|
|
|
|
|
|
=item gele example 8 |
1436
|
|
|
|
|
|
|
|
1437
|
|
|
|
|
|
|
package main; |
1438
|
|
|
|
|
|
|
|
1439
|
|
|
|
|
|
|
use Venus::Number; |
1440
|
|
|
|
|
|
|
use Venus::String; |
1441
|
|
|
|
|
|
|
|
1442
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1443
|
|
|
|
|
|
|
my $rvalue = Venus::String->new; |
1444
|
|
|
|
|
|
|
|
1445
|
|
|
|
|
|
|
my $result = $lvalue->gele($rvalue); |
1446
|
|
|
|
|
|
|
|
1447
|
|
|
|
|
|
|
# 1 |
1448
|
|
|
|
|
|
|
|
1449
|
|
|
|
|
|
|
=back |
1450
|
|
|
|
|
|
|
|
1451
|
|
|
|
|
|
|
=over 4 |
1452
|
|
|
|
|
|
|
|
1453
|
|
|
|
|
|
|
=item gele example 9 |
1454
|
|
|
|
|
|
|
|
1455
|
|
|
|
|
|
|
package main; |
1456
|
|
|
|
|
|
|
|
1457
|
|
|
|
|
|
|
use Venus::Number; |
1458
|
|
|
|
|
|
|
use Venus::Undef; |
1459
|
|
|
|
|
|
|
|
1460
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1461
|
|
|
|
|
|
|
my $rvalue = Venus::Undef->new; |
1462
|
|
|
|
|
|
|
|
1463
|
|
|
|
|
|
|
my $result = $lvalue->gele($rvalue); |
1464
|
|
|
|
|
|
|
|
1465
|
|
|
|
|
|
|
# 1 |
1466
|
|
|
|
|
|
|
|
1467
|
|
|
|
|
|
|
=back |
1468
|
|
|
|
|
|
|
|
1469
|
|
|
|
|
|
|
=cut |
1470
|
|
|
|
|
|
|
|
1471
|
|
|
|
|
|
|
=head2 gt |
1472
|
|
|
|
|
|
|
|
1473
|
|
|
|
|
|
|
gt(any $arg) (boolean) |
1474
|
|
|
|
|
|
|
|
1475
|
|
|
|
|
|
|
The gt method performs a I<"greater-than"> operation using the argument provided. |
1476
|
|
|
|
|
|
|
|
1477
|
|
|
|
|
|
|
I> |
1478
|
|
|
|
|
|
|
|
1479
|
|
|
|
|
|
|
=over 4 |
1480
|
|
|
|
|
|
|
|
1481
|
|
|
|
|
|
|
=item gt example 1 |
1482
|
|
|
|
|
|
|
|
1483
|
|
|
|
|
|
|
package main; |
1484
|
|
|
|
|
|
|
|
1485
|
|
|
|
|
|
|
use Venus::Array; |
1486
|
|
|
|
|
|
|
use Venus::Number; |
1487
|
|
|
|
|
|
|
|
1488
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1489
|
|
|
|
|
|
|
my $rvalue = Venus::Array->new; |
1490
|
|
|
|
|
|
|
|
1491
|
|
|
|
|
|
|
my $result = $lvalue->gt($rvalue); |
1492
|
|
|
|
|
|
|
|
1493
|
|
|
|
|
|
|
# 0 |
1494
|
|
|
|
|
|
|
|
1495
|
|
|
|
|
|
|
=back |
1496
|
|
|
|
|
|
|
|
1497
|
|
|
|
|
|
|
=over 4 |
1498
|
|
|
|
|
|
|
|
1499
|
|
|
|
|
|
|
=item gt example 2 |
1500
|
|
|
|
|
|
|
|
1501
|
|
|
|
|
|
|
package main; |
1502
|
|
|
|
|
|
|
|
1503
|
|
|
|
|
|
|
use Venus::Code; |
1504
|
|
|
|
|
|
|
use Venus::Number; |
1505
|
|
|
|
|
|
|
|
1506
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1507
|
|
|
|
|
|
|
my $rvalue = Venus::Code->new; |
1508
|
|
|
|
|
|
|
|
1509
|
|
|
|
|
|
|
my $result = $lvalue->gt($rvalue); |
1510
|
|
|
|
|
|
|
|
1511
|
|
|
|
|
|
|
# 0 |
1512
|
|
|
|
|
|
|
|
1513
|
|
|
|
|
|
|
=back |
1514
|
|
|
|
|
|
|
|
1515
|
|
|
|
|
|
|
=over 4 |
1516
|
|
|
|
|
|
|
|
1517
|
|
|
|
|
|
|
=item gt example 3 |
1518
|
|
|
|
|
|
|
|
1519
|
|
|
|
|
|
|
package main; |
1520
|
|
|
|
|
|
|
|
1521
|
|
|
|
|
|
|
use Venus::Float; |
1522
|
|
|
|
|
|
|
use Venus::Number; |
1523
|
|
|
|
|
|
|
|
1524
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1525
|
|
|
|
|
|
|
my $rvalue = Venus::Float->new; |
1526
|
|
|
|
|
|
|
|
1527
|
|
|
|
|
|
|
my $result = $lvalue->gt($rvalue); |
1528
|
|
|
|
|
|
|
|
1529
|
|
|
|
|
|
|
# 0 |
1530
|
|
|
|
|
|
|
|
1531
|
|
|
|
|
|
|
=back |
1532
|
|
|
|
|
|
|
|
1533
|
|
|
|
|
|
|
=over 4 |
1534
|
|
|
|
|
|
|
|
1535
|
|
|
|
|
|
|
=item gt example 4 |
1536
|
|
|
|
|
|
|
|
1537
|
|
|
|
|
|
|
package main; |
1538
|
|
|
|
|
|
|
|
1539
|
|
|
|
|
|
|
use Venus::Hash; |
1540
|
|
|
|
|
|
|
use Venus::Number; |
1541
|
|
|
|
|
|
|
|
1542
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1543
|
|
|
|
|
|
|
my $rvalue = Venus::Hash->new; |
1544
|
|
|
|
|
|
|
|
1545
|
|
|
|
|
|
|
my $result = $lvalue->gt($rvalue); |
1546
|
|
|
|
|
|
|
|
1547
|
|
|
|
|
|
|
# 0 |
1548
|
|
|
|
|
|
|
|
1549
|
|
|
|
|
|
|
=back |
1550
|
|
|
|
|
|
|
|
1551
|
|
|
|
|
|
|
=over 4 |
1552
|
|
|
|
|
|
|
|
1553
|
|
|
|
|
|
|
=item gt example 5 |
1554
|
|
|
|
|
|
|
|
1555
|
|
|
|
|
|
|
package main; |
1556
|
|
|
|
|
|
|
|
1557
|
|
|
|
|
|
|
use Venus::Number; |
1558
|
|
|
|
|
|
|
|
1559
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1560
|
|
|
|
|
|
|
my $rvalue = Venus::Number->new; |
1561
|
|
|
|
|
|
|
|
1562
|
|
|
|
|
|
|
my $result = $lvalue->gt($rvalue); |
1563
|
|
|
|
|
|
|
|
1564
|
|
|
|
|
|
|
# 0 |
1565
|
|
|
|
|
|
|
|
1566
|
|
|
|
|
|
|
=back |
1567
|
|
|
|
|
|
|
|
1568
|
|
|
|
|
|
|
=over 4 |
1569
|
|
|
|
|
|
|
|
1570
|
|
|
|
|
|
|
=item gt example 6 |
1571
|
|
|
|
|
|
|
|
1572
|
|
|
|
|
|
|
package main; |
1573
|
|
|
|
|
|
|
|
1574
|
|
|
|
|
|
|
use Venus::Number; |
1575
|
|
|
|
|
|
|
use Venus::Regexp; |
1576
|
|
|
|
|
|
|
|
1577
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1578
|
|
|
|
|
|
|
my $rvalue = Venus::Regexp->new; |
1579
|
|
|
|
|
|
|
|
1580
|
|
|
|
|
|
|
my $result = $lvalue->gt($rvalue); |
1581
|
|
|
|
|
|
|
|
1582
|
|
|
|
|
|
|
# 0 |
1583
|
|
|
|
|
|
|
|
1584
|
|
|
|
|
|
|
=back |
1585
|
|
|
|
|
|
|
|
1586
|
|
|
|
|
|
|
=over 4 |
1587
|
|
|
|
|
|
|
|
1588
|
|
|
|
|
|
|
=item gt example 7 |
1589
|
|
|
|
|
|
|
|
1590
|
|
|
|
|
|
|
package main; |
1591
|
|
|
|
|
|
|
|
1592
|
|
|
|
|
|
|
use Venus::Number; |
1593
|
|
|
|
|
|
|
use Venus::Scalar; |
1594
|
|
|
|
|
|
|
|
1595
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1596
|
|
|
|
|
|
|
my $rvalue = Venus::Scalar->new; |
1597
|
|
|
|
|
|
|
|
1598
|
|
|
|
|
|
|
my $result = $lvalue->gt($rvalue); |
1599
|
|
|
|
|
|
|
|
1600
|
|
|
|
|
|
|
# 0 |
1601
|
|
|
|
|
|
|
|
1602
|
|
|
|
|
|
|
=back |
1603
|
|
|
|
|
|
|
|
1604
|
|
|
|
|
|
|
=over 4 |
1605
|
|
|
|
|
|
|
|
1606
|
|
|
|
|
|
|
=item gt example 8 |
1607
|
|
|
|
|
|
|
|
1608
|
|
|
|
|
|
|
package main; |
1609
|
|
|
|
|
|
|
|
1610
|
|
|
|
|
|
|
use Venus::Number; |
1611
|
|
|
|
|
|
|
use Venus::String; |
1612
|
|
|
|
|
|
|
|
1613
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1614
|
|
|
|
|
|
|
my $rvalue = Venus::String->new; |
1615
|
|
|
|
|
|
|
|
1616
|
|
|
|
|
|
|
my $result = $lvalue->gt($rvalue); |
1617
|
|
|
|
|
|
|
|
1618
|
|
|
|
|
|
|
# 0 |
1619
|
|
|
|
|
|
|
|
1620
|
|
|
|
|
|
|
=back |
1621
|
|
|
|
|
|
|
|
1622
|
|
|
|
|
|
|
=over 4 |
1623
|
|
|
|
|
|
|
|
1624
|
|
|
|
|
|
|
=item gt example 9 |
1625
|
|
|
|
|
|
|
|
1626
|
|
|
|
|
|
|
package main; |
1627
|
|
|
|
|
|
|
|
1628
|
|
|
|
|
|
|
use Venus::Number; |
1629
|
|
|
|
|
|
|
use Venus::Undef; |
1630
|
|
|
|
|
|
|
|
1631
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1632
|
|
|
|
|
|
|
my $rvalue = Venus::Undef->new; |
1633
|
|
|
|
|
|
|
|
1634
|
|
|
|
|
|
|
my $result = $lvalue->gt($rvalue); |
1635
|
|
|
|
|
|
|
|
1636
|
|
|
|
|
|
|
# 0 |
1637
|
|
|
|
|
|
|
|
1638
|
|
|
|
|
|
|
=back |
1639
|
|
|
|
|
|
|
|
1640
|
|
|
|
|
|
|
=cut |
1641
|
|
|
|
|
|
|
|
1642
|
|
|
|
|
|
|
=head2 gtlt |
1643
|
|
|
|
|
|
|
|
1644
|
|
|
|
|
|
|
gtlt(any $arg1, any $arg2) (boolean) |
1645
|
|
|
|
|
|
|
|
1646
|
|
|
|
|
|
|
The gtlt method performs a I<"greater-than"> operation on the 1st argument, and |
1647
|
|
|
|
|
|
|
I<"lesser-than"> operation on the 2nd argument. |
1648
|
|
|
|
|
|
|
|
1649
|
|
|
|
|
|
|
I> |
1650
|
|
|
|
|
|
|
|
1651
|
|
|
|
|
|
|
=over 4 |
1652
|
|
|
|
|
|
|
|
1653
|
|
|
|
|
|
|
=item gtlt example 1 |
1654
|
|
|
|
|
|
|
|
1655
|
|
|
|
|
|
|
package main; |
1656
|
|
|
|
|
|
|
|
1657
|
|
|
|
|
|
|
use Venus::Array; |
1658
|
|
|
|
|
|
|
use Venus::Number; |
1659
|
|
|
|
|
|
|
|
1660
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1661
|
|
|
|
|
|
|
my $rvalue = Venus::Array->new; |
1662
|
|
|
|
|
|
|
|
1663
|
|
|
|
|
|
|
my $result = $lvalue->gtlt($rvalue); |
1664
|
|
|
|
|
|
|
|
1665
|
|
|
|
|
|
|
# 0 |
1666
|
|
|
|
|
|
|
|
1667
|
|
|
|
|
|
|
=back |
1668
|
|
|
|
|
|
|
|
1669
|
|
|
|
|
|
|
=over 4 |
1670
|
|
|
|
|
|
|
|
1671
|
|
|
|
|
|
|
=item gtlt example 2 |
1672
|
|
|
|
|
|
|
|
1673
|
|
|
|
|
|
|
package main; |
1674
|
|
|
|
|
|
|
|
1675
|
|
|
|
|
|
|
use Venus::Code; |
1676
|
|
|
|
|
|
|
use Venus::Number; |
1677
|
|
|
|
|
|
|
|
1678
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1679
|
|
|
|
|
|
|
my $rvalue = Venus::Code->new; |
1680
|
|
|
|
|
|
|
|
1681
|
|
|
|
|
|
|
my $result = $lvalue->gtlt($rvalue); |
1682
|
|
|
|
|
|
|
|
1683
|
|
|
|
|
|
|
# 0 |
1684
|
|
|
|
|
|
|
|
1685
|
|
|
|
|
|
|
=back |
1686
|
|
|
|
|
|
|
|
1687
|
|
|
|
|
|
|
=over 4 |
1688
|
|
|
|
|
|
|
|
1689
|
|
|
|
|
|
|
=item gtlt example 3 |
1690
|
|
|
|
|
|
|
|
1691
|
|
|
|
|
|
|
package main; |
1692
|
|
|
|
|
|
|
|
1693
|
|
|
|
|
|
|
use Venus::Float; |
1694
|
|
|
|
|
|
|
use Venus::Number; |
1695
|
|
|
|
|
|
|
|
1696
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1697
|
|
|
|
|
|
|
my $rvalue = Venus::Float->new; |
1698
|
|
|
|
|
|
|
|
1699
|
|
|
|
|
|
|
my $result = $lvalue->gtlt($rvalue); |
1700
|
|
|
|
|
|
|
|
1701
|
|
|
|
|
|
|
# 0 |
1702
|
|
|
|
|
|
|
|
1703
|
|
|
|
|
|
|
=back |
1704
|
|
|
|
|
|
|
|
1705
|
|
|
|
|
|
|
=over 4 |
1706
|
|
|
|
|
|
|
|
1707
|
|
|
|
|
|
|
=item gtlt example 4 |
1708
|
|
|
|
|
|
|
|
1709
|
|
|
|
|
|
|
package main; |
1710
|
|
|
|
|
|
|
|
1711
|
|
|
|
|
|
|
use Venus::Hash; |
1712
|
|
|
|
|
|
|
use Venus::Number; |
1713
|
|
|
|
|
|
|
|
1714
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1715
|
|
|
|
|
|
|
my $rvalue = Venus::Hash->new; |
1716
|
|
|
|
|
|
|
|
1717
|
|
|
|
|
|
|
my $result = $lvalue->gtlt($rvalue); |
1718
|
|
|
|
|
|
|
|
1719
|
|
|
|
|
|
|
# 0 |
1720
|
|
|
|
|
|
|
|
1721
|
|
|
|
|
|
|
=back |
1722
|
|
|
|
|
|
|
|
1723
|
|
|
|
|
|
|
=over 4 |
1724
|
|
|
|
|
|
|
|
1725
|
|
|
|
|
|
|
=item gtlt example 5 |
1726
|
|
|
|
|
|
|
|
1727
|
|
|
|
|
|
|
package main; |
1728
|
|
|
|
|
|
|
|
1729
|
|
|
|
|
|
|
use Venus::Number; |
1730
|
|
|
|
|
|
|
|
1731
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1732
|
|
|
|
|
|
|
my $rvalue = Venus::Number->new; |
1733
|
|
|
|
|
|
|
|
1734
|
|
|
|
|
|
|
my $result = $lvalue->gtlt($rvalue); |
1735
|
|
|
|
|
|
|
|
1736
|
|
|
|
|
|
|
# 0 |
1737
|
|
|
|
|
|
|
|
1738
|
|
|
|
|
|
|
=back |
1739
|
|
|
|
|
|
|
|
1740
|
|
|
|
|
|
|
=over 4 |
1741
|
|
|
|
|
|
|
|
1742
|
|
|
|
|
|
|
=item gtlt example 6 |
1743
|
|
|
|
|
|
|
|
1744
|
|
|
|
|
|
|
package main; |
1745
|
|
|
|
|
|
|
|
1746
|
|
|
|
|
|
|
use Venus::Number; |
1747
|
|
|
|
|
|
|
use Venus::Regexp; |
1748
|
|
|
|
|
|
|
|
1749
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1750
|
|
|
|
|
|
|
my $rvalue = Venus::Regexp->new; |
1751
|
|
|
|
|
|
|
|
1752
|
|
|
|
|
|
|
my $result = $lvalue->gtlt($rvalue); |
1753
|
|
|
|
|
|
|
|
1754
|
|
|
|
|
|
|
# 0 |
1755
|
|
|
|
|
|
|
|
1756
|
|
|
|
|
|
|
=back |
1757
|
|
|
|
|
|
|
|
1758
|
|
|
|
|
|
|
=over 4 |
1759
|
|
|
|
|
|
|
|
1760
|
|
|
|
|
|
|
=item gtlt example 7 |
1761
|
|
|
|
|
|
|
|
1762
|
|
|
|
|
|
|
package main; |
1763
|
|
|
|
|
|
|
|
1764
|
|
|
|
|
|
|
use Venus::Number; |
1765
|
|
|
|
|
|
|
use Venus::Scalar; |
1766
|
|
|
|
|
|
|
|
1767
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1768
|
|
|
|
|
|
|
my $rvalue = Venus::Scalar->new; |
1769
|
|
|
|
|
|
|
|
1770
|
|
|
|
|
|
|
my $result = $lvalue->gtlt($rvalue); |
1771
|
|
|
|
|
|
|
|
1772
|
|
|
|
|
|
|
# 0 |
1773
|
|
|
|
|
|
|
|
1774
|
|
|
|
|
|
|
=back |
1775
|
|
|
|
|
|
|
|
1776
|
|
|
|
|
|
|
=over 4 |
1777
|
|
|
|
|
|
|
|
1778
|
|
|
|
|
|
|
=item gtlt example 8 |
1779
|
|
|
|
|
|
|
|
1780
|
|
|
|
|
|
|
package main; |
1781
|
|
|
|
|
|
|
|
1782
|
|
|
|
|
|
|
use Venus::Number; |
1783
|
|
|
|
|
|
|
use Venus::String; |
1784
|
|
|
|
|
|
|
|
1785
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1786
|
|
|
|
|
|
|
my $rvalue = Venus::String->new; |
1787
|
|
|
|
|
|
|
|
1788
|
|
|
|
|
|
|
my $result = $lvalue->gtlt($rvalue); |
1789
|
|
|
|
|
|
|
|
1790
|
|
|
|
|
|
|
# 0 |
1791
|
|
|
|
|
|
|
|
1792
|
|
|
|
|
|
|
=back |
1793
|
|
|
|
|
|
|
|
1794
|
|
|
|
|
|
|
=over 4 |
1795
|
|
|
|
|
|
|
|
1796
|
|
|
|
|
|
|
=item gtlt example 9 |
1797
|
|
|
|
|
|
|
|
1798
|
|
|
|
|
|
|
package main; |
1799
|
|
|
|
|
|
|
|
1800
|
|
|
|
|
|
|
use Venus::Number; |
1801
|
|
|
|
|
|
|
use Venus::Undef; |
1802
|
|
|
|
|
|
|
|
1803
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1804
|
|
|
|
|
|
|
my $rvalue = Venus::Undef->new; |
1805
|
|
|
|
|
|
|
|
1806
|
|
|
|
|
|
|
my $result = $lvalue->gtlt($rvalue); |
1807
|
|
|
|
|
|
|
|
1808
|
|
|
|
|
|
|
# 0 |
1809
|
|
|
|
|
|
|
|
1810
|
|
|
|
|
|
|
=back |
1811
|
|
|
|
|
|
|
|
1812
|
|
|
|
|
|
|
=cut |
1813
|
|
|
|
|
|
|
|
1814
|
|
|
|
|
|
|
=head2 hex |
1815
|
|
|
|
|
|
|
|
1816
|
|
|
|
|
|
|
hex() (string) |
1817
|
|
|
|
|
|
|
|
1818
|
|
|
|
|
|
|
The hex method returns a hex string representing the value of the number. |
1819
|
|
|
|
|
|
|
|
1820
|
|
|
|
|
|
|
I> |
1821
|
|
|
|
|
|
|
|
1822
|
|
|
|
|
|
|
=over 4 |
1823
|
|
|
|
|
|
|
|
1824
|
|
|
|
|
|
|
=item hex example 1 |
1825
|
|
|
|
|
|
|
|
1826
|
|
|
|
|
|
|
package main; |
1827
|
|
|
|
|
|
|
|
1828
|
|
|
|
|
|
|
use Venus::Number; |
1829
|
|
|
|
|
|
|
|
1830
|
|
|
|
|
|
|
my $number = Venus::Number->new(175); |
1831
|
|
|
|
|
|
|
|
1832
|
|
|
|
|
|
|
my $hex = $number->hex; |
1833
|
|
|
|
|
|
|
|
1834
|
|
|
|
|
|
|
# "0xaf" |
1835
|
|
|
|
|
|
|
|
1836
|
|
|
|
|
|
|
=back |
1837
|
|
|
|
|
|
|
|
1838
|
|
|
|
|
|
|
=cut |
1839
|
|
|
|
|
|
|
|
1840
|
|
|
|
|
|
|
=head2 incr |
1841
|
|
|
|
|
|
|
|
1842
|
|
|
|
|
|
|
incr() (Num) |
1843
|
|
|
|
|
|
|
|
1844
|
|
|
|
|
|
|
The incr method returns the numeric number incremented by 1. |
1845
|
|
|
|
|
|
|
|
1846
|
|
|
|
|
|
|
I> |
1847
|
|
|
|
|
|
|
|
1848
|
|
|
|
|
|
|
=over 4 |
1849
|
|
|
|
|
|
|
|
1850
|
|
|
|
|
|
|
=item incr example 1 |
1851
|
|
|
|
|
|
|
|
1852
|
|
|
|
|
|
|
package main; |
1853
|
|
|
|
|
|
|
|
1854
|
|
|
|
|
|
|
use Venus::Number; |
1855
|
|
|
|
|
|
|
|
1856
|
|
|
|
|
|
|
my $number = Venus::Number->new(123456789); |
1857
|
|
|
|
|
|
|
|
1858
|
|
|
|
|
|
|
my $incr = $number->incr; |
1859
|
|
|
|
|
|
|
|
1860
|
|
|
|
|
|
|
# 123456790 |
1861
|
|
|
|
|
|
|
|
1862
|
|
|
|
|
|
|
=back |
1863
|
|
|
|
|
|
|
|
1864
|
|
|
|
|
|
|
=over 4 |
1865
|
|
|
|
|
|
|
|
1866
|
|
|
|
|
|
|
=item incr example 2 |
1867
|
|
|
|
|
|
|
|
1868
|
|
|
|
|
|
|
package main; |
1869
|
|
|
|
|
|
|
|
1870
|
|
|
|
|
|
|
use Venus::Number; |
1871
|
|
|
|
|
|
|
|
1872
|
|
|
|
|
|
|
my $number = Venus::Number->new(123456790); |
1873
|
|
|
|
|
|
|
|
1874
|
|
|
|
|
|
|
my $incr = $number->incr(-1); |
1875
|
|
|
|
|
|
|
|
1876
|
|
|
|
|
|
|
# 123456789 |
1877
|
|
|
|
|
|
|
|
1878
|
|
|
|
|
|
|
=back |
1879
|
|
|
|
|
|
|
|
1880
|
|
|
|
|
|
|
=cut |
1881
|
|
|
|
|
|
|
|
1882
|
|
|
|
|
|
|
=head2 index |
1883
|
|
|
|
|
|
|
|
1884
|
|
|
|
|
|
|
index(string $substr, number $start) (Num) |
1885
|
|
|
|
|
|
|
|
1886
|
|
|
|
|
|
|
The index method searches for the argument within the number and returns the |
1887
|
|
|
|
|
|
|
position of the first occurrence of the argument. |
1888
|
|
|
|
|
|
|
|
1889
|
|
|
|
|
|
|
I> |
1890
|
|
|
|
|
|
|
|
1891
|
|
|
|
|
|
|
=over 4 |
1892
|
|
|
|
|
|
|
|
1893
|
|
|
|
|
|
|
=item index example 1 |
1894
|
|
|
|
|
|
|
|
1895
|
|
|
|
|
|
|
package main; |
1896
|
|
|
|
|
|
|
|
1897
|
|
|
|
|
|
|
use Venus::Number; |
1898
|
|
|
|
|
|
|
|
1899
|
|
|
|
|
|
|
my $number = Venus::Number->new(1_0001); |
1900
|
|
|
|
|
|
|
|
1901
|
|
|
|
|
|
|
my $index = $number->index(0); |
1902
|
|
|
|
|
|
|
|
1903
|
|
|
|
|
|
|
# 1 |
1904
|
|
|
|
|
|
|
|
1905
|
|
|
|
|
|
|
=back |
1906
|
|
|
|
|
|
|
|
1907
|
|
|
|
|
|
|
=over 4 |
1908
|
|
|
|
|
|
|
|
1909
|
|
|
|
|
|
|
=item index example 2 |
1910
|
|
|
|
|
|
|
|
1911
|
|
|
|
|
|
|
package main; |
1912
|
|
|
|
|
|
|
|
1913
|
|
|
|
|
|
|
use Venus::Number; |
1914
|
|
|
|
|
|
|
|
1915
|
|
|
|
|
|
|
my $number = Venus::Number->new(1_0001); |
1916
|
|
|
|
|
|
|
|
1917
|
|
|
|
|
|
|
my $index = $number->index(1, 1); |
1918
|
|
|
|
|
|
|
|
1919
|
|
|
|
|
|
|
# 4 |
1920
|
|
|
|
|
|
|
|
1921
|
|
|
|
|
|
|
=back |
1922
|
|
|
|
|
|
|
|
1923
|
|
|
|
|
|
|
=over 4 |
1924
|
|
|
|
|
|
|
|
1925
|
|
|
|
|
|
|
=item index example 3 |
1926
|
|
|
|
|
|
|
|
1927
|
|
|
|
|
|
|
package main; |
1928
|
|
|
|
|
|
|
|
1929
|
|
|
|
|
|
|
use Venus::Number; |
1930
|
|
|
|
|
|
|
|
1931
|
|
|
|
|
|
|
my $number = Venus::Number->new(1_0001); |
1932
|
|
|
|
|
|
|
|
1933
|
|
|
|
|
|
|
my $index = $number->index(2); |
1934
|
|
|
|
|
|
|
|
1935
|
|
|
|
|
|
|
# -1 |
1936
|
|
|
|
|
|
|
|
1937
|
|
|
|
|
|
|
=back |
1938
|
|
|
|
|
|
|
|
1939
|
|
|
|
|
|
|
=cut |
1940
|
|
|
|
|
|
|
|
1941
|
|
|
|
|
|
|
=head2 int |
1942
|
|
|
|
|
|
|
|
1943
|
|
|
|
|
|
|
int() (Num) |
1944
|
|
|
|
|
|
|
|
1945
|
|
|
|
|
|
|
The int method returns the integer portion of the number. Do not use this |
1946
|
|
|
|
|
|
|
method for rounding. |
1947
|
|
|
|
|
|
|
|
1948
|
|
|
|
|
|
|
I> |
1949
|
|
|
|
|
|
|
|
1950
|
|
|
|
|
|
|
=over 4 |
1951
|
|
|
|
|
|
|
|
1952
|
|
|
|
|
|
|
=item int example 1 |
1953
|
|
|
|
|
|
|
|
1954
|
|
|
|
|
|
|
package main; |
1955
|
|
|
|
|
|
|
|
1956
|
|
|
|
|
|
|
use Venus::Number; |
1957
|
|
|
|
|
|
|
|
1958
|
|
|
|
|
|
|
my $number = Venus::Number->new(12.5); |
1959
|
|
|
|
|
|
|
|
1960
|
|
|
|
|
|
|
my $int = $number->int; |
1961
|
|
|
|
|
|
|
|
1962
|
|
|
|
|
|
|
# 12 |
1963
|
|
|
|
|
|
|
|
1964
|
|
|
|
|
|
|
=back |
1965
|
|
|
|
|
|
|
|
1966
|
|
|
|
|
|
|
=cut |
1967
|
|
|
|
|
|
|
|
1968
|
|
|
|
|
|
|
=head2 le |
1969
|
|
|
|
|
|
|
|
1970
|
|
|
|
|
|
|
le(any $arg) (boolean) |
1971
|
|
|
|
|
|
|
|
1972
|
|
|
|
|
|
|
The le method performs a I<"lesser-than-or-equal-to"> operation using the |
1973
|
|
|
|
|
|
|
argument provided. |
1974
|
|
|
|
|
|
|
|
1975
|
|
|
|
|
|
|
I> |
1976
|
|
|
|
|
|
|
|
1977
|
|
|
|
|
|
|
=over 4 |
1978
|
|
|
|
|
|
|
|
1979
|
|
|
|
|
|
|
=item le example 1 |
1980
|
|
|
|
|
|
|
|
1981
|
|
|
|
|
|
|
package main; |
1982
|
|
|
|
|
|
|
|
1983
|
|
|
|
|
|
|
use Venus::Array; |
1984
|
|
|
|
|
|
|
use Venus::Number; |
1985
|
|
|
|
|
|
|
|
1986
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
1987
|
|
|
|
|
|
|
my $rvalue = Venus::Array->new; |
1988
|
|
|
|
|
|
|
|
1989
|
|
|
|
|
|
|
my $result = $lvalue->le($rvalue); |
1990
|
|
|
|
|
|
|
|
1991
|
|
|
|
|
|
|
# 1 |
1992
|
|
|
|
|
|
|
|
1993
|
|
|
|
|
|
|
=back |
1994
|
|
|
|
|
|
|
|
1995
|
|
|
|
|
|
|
=over 4 |
1996
|
|
|
|
|
|
|
|
1997
|
|
|
|
|
|
|
=item le example 2 |
1998
|
|
|
|
|
|
|
|
1999
|
|
|
|
|
|
|
package main; |
2000
|
|
|
|
|
|
|
|
2001
|
|
|
|
|
|
|
use Venus::Code; |
2002
|
|
|
|
|
|
|
use Venus::Number; |
2003
|
|
|
|
|
|
|
|
2004
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2005
|
|
|
|
|
|
|
my $rvalue = Venus::Code->new; |
2006
|
|
|
|
|
|
|
|
2007
|
|
|
|
|
|
|
my $result = $lvalue->le($rvalue); |
2008
|
|
|
|
|
|
|
|
2009
|
|
|
|
|
|
|
# 1 |
2010
|
|
|
|
|
|
|
|
2011
|
|
|
|
|
|
|
=back |
2012
|
|
|
|
|
|
|
|
2013
|
|
|
|
|
|
|
=over 4 |
2014
|
|
|
|
|
|
|
|
2015
|
|
|
|
|
|
|
=item le example 3 |
2016
|
|
|
|
|
|
|
|
2017
|
|
|
|
|
|
|
package main; |
2018
|
|
|
|
|
|
|
|
2019
|
|
|
|
|
|
|
use Venus::Float; |
2020
|
|
|
|
|
|
|
use Venus::Number; |
2021
|
|
|
|
|
|
|
|
2022
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2023
|
|
|
|
|
|
|
my $rvalue = Venus::Float->new; |
2024
|
|
|
|
|
|
|
|
2025
|
|
|
|
|
|
|
my $result = $lvalue->le($rvalue); |
2026
|
|
|
|
|
|
|
|
2027
|
|
|
|
|
|
|
# 1 |
2028
|
|
|
|
|
|
|
|
2029
|
|
|
|
|
|
|
=back |
2030
|
|
|
|
|
|
|
|
2031
|
|
|
|
|
|
|
=over 4 |
2032
|
|
|
|
|
|
|
|
2033
|
|
|
|
|
|
|
=item le example 4 |
2034
|
|
|
|
|
|
|
|
2035
|
|
|
|
|
|
|
package main; |
2036
|
|
|
|
|
|
|
|
2037
|
|
|
|
|
|
|
use Venus::Hash; |
2038
|
|
|
|
|
|
|
use Venus::Number; |
2039
|
|
|
|
|
|
|
|
2040
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2041
|
|
|
|
|
|
|
my $rvalue = Venus::Hash->new; |
2042
|
|
|
|
|
|
|
|
2043
|
|
|
|
|
|
|
my $result = $lvalue->le($rvalue); |
2044
|
|
|
|
|
|
|
|
2045
|
|
|
|
|
|
|
# 1 |
2046
|
|
|
|
|
|
|
|
2047
|
|
|
|
|
|
|
=back |
2048
|
|
|
|
|
|
|
|
2049
|
|
|
|
|
|
|
=over 4 |
2050
|
|
|
|
|
|
|
|
2051
|
|
|
|
|
|
|
=item le example 5 |
2052
|
|
|
|
|
|
|
|
2053
|
|
|
|
|
|
|
package main; |
2054
|
|
|
|
|
|
|
|
2055
|
|
|
|
|
|
|
use Venus::Number; |
2056
|
|
|
|
|
|
|
|
2057
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2058
|
|
|
|
|
|
|
my $rvalue = Venus::Number->new; |
2059
|
|
|
|
|
|
|
|
2060
|
|
|
|
|
|
|
my $result = $lvalue->le($rvalue); |
2061
|
|
|
|
|
|
|
|
2062
|
|
|
|
|
|
|
# 1 |
2063
|
|
|
|
|
|
|
|
2064
|
|
|
|
|
|
|
=back |
2065
|
|
|
|
|
|
|
|
2066
|
|
|
|
|
|
|
=over 4 |
2067
|
|
|
|
|
|
|
|
2068
|
|
|
|
|
|
|
=item le example 6 |
2069
|
|
|
|
|
|
|
|
2070
|
|
|
|
|
|
|
package main; |
2071
|
|
|
|
|
|
|
|
2072
|
|
|
|
|
|
|
use Venus::Number; |
2073
|
|
|
|
|
|
|
use Venus::Regexp; |
2074
|
|
|
|
|
|
|
|
2075
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2076
|
|
|
|
|
|
|
my $rvalue = Venus::Regexp->new; |
2077
|
|
|
|
|
|
|
|
2078
|
|
|
|
|
|
|
my $result = $lvalue->le($rvalue); |
2079
|
|
|
|
|
|
|
|
2080
|
|
|
|
|
|
|
# 1 |
2081
|
|
|
|
|
|
|
|
2082
|
|
|
|
|
|
|
=back |
2083
|
|
|
|
|
|
|
|
2084
|
|
|
|
|
|
|
=over 4 |
2085
|
|
|
|
|
|
|
|
2086
|
|
|
|
|
|
|
=item le example 7 |
2087
|
|
|
|
|
|
|
|
2088
|
|
|
|
|
|
|
package main; |
2089
|
|
|
|
|
|
|
|
2090
|
|
|
|
|
|
|
use Venus::Number; |
2091
|
|
|
|
|
|
|
use Venus::Scalar; |
2092
|
|
|
|
|
|
|
|
2093
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2094
|
|
|
|
|
|
|
my $rvalue = Venus::Scalar->new; |
2095
|
|
|
|
|
|
|
|
2096
|
|
|
|
|
|
|
my $result = $lvalue->le($rvalue); |
2097
|
|
|
|
|
|
|
|
2098
|
|
|
|
|
|
|
# 1 |
2099
|
|
|
|
|
|
|
|
2100
|
|
|
|
|
|
|
=back |
2101
|
|
|
|
|
|
|
|
2102
|
|
|
|
|
|
|
=over 4 |
2103
|
|
|
|
|
|
|
|
2104
|
|
|
|
|
|
|
=item le example 8 |
2105
|
|
|
|
|
|
|
|
2106
|
|
|
|
|
|
|
package main; |
2107
|
|
|
|
|
|
|
|
2108
|
|
|
|
|
|
|
use Venus::Number; |
2109
|
|
|
|
|
|
|
use Venus::String; |
2110
|
|
|
|
|
|
|
|
2111
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2112
|
|
|
|
|
|
|
my $rvalue = Venus::String->new; |
2113
|
|
|
|
|
|
|
|
2114
|
|
|
|
|
|
|
my $result = $lvalue->le($rvalue); |
2115
|
|
|
|
|
|
|
|
2116
|
|
|
|
|
|
|
# 1 |
2117
|
|
|
|
|
|
|
|
2118
|
|
|
|
|
|
|
=back |
2119
|
|
|
|
|
|
|
|
2120
|
|
|
|
|
|
|
=over 4 |
2121
|
|
|
|
|
|
|
|
2122
|
|
|
|
|
|
|
=item le example 9 |
2123
|
|
|
|
|
|
|
|
2124
|
|
|
|
|
|
|
package main; |
2125
|
|
|
|
|
|
|
|
2126
|
|
|
|
|
|
|
use Venus::Number; |
2127
|
|
|
|
|
|
|
use Venus::Undef; |
2128
|
|
|
|
|
|
|
|
2129
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2130
|
|
|
|
|
|
|
my $rvalue = Venus::Undef->new; |
2131
|
|
|
|
|
|
|
|
2132
|
|
|
|
|
|
|
my $result = $lvalue->le($rvalue); |
2133
|
|
|
|
|
|
|
|
2134
|
|
|
|
|
|
|
# 1 |
2135
|
|
|
|
|
|
|
|
2136
|
|
|
|
|
|
|
=back |
2137
|
|
|
|
|
|
|
|
2138
|
|
|
|
|
|
|
=cut |
2139
|
|
|
|
|
|
|
|
2140
|
|
|
|
|
|
|
=head2 length |
2141
|
|
|
|
|
|
|
|
2142
|
|
|
|
|
|
|
length() (Num) |
2143
|
|
|
|
|
|
|
|
2144
|
|
|
|
|
|
|
The length method returns the number of characters within the number. |
2145
|
|
|
|
|
|
|
|
2146
|
|
|
|
|
|
|
I> |
2147
|
|
|
|
|
|
|
|
2148
|
|
|
|
|
|
|
=over 4 |
2149
|
|
|
|
|
|
|
|
2150
|
|
|
|
|
|
|
=item length example 1 |
2151
|
|
|
|
|
|
|
|
2152
|
|
|
|
|
|
|
# given: synopsis; |
2153
|
|
|
|
|
|
|
|
2154
|
|
|
|
|
|
|
my $length = $number->length; |
2155
|
|
|
|
|
|
|
|
2156
|
|
|
|
|
|
|
# 4 |
2157
|
|
|
|
|
|
|
|
2158
|
|
|
|
|
|
|
=back |
2159
|
|
|
|
|
|
|
|
2160
|
|
|
|
|
|
|
=cut |
2161
|
|
|
|
|
|
|
|
2162
|
|
|
|
|
|
|
=head2 log |
2163
|
|
|
|
|
|
|
|
2164
|
|
|
|
|
|
|
log() (Num) |
2165
|
|
|
|
|
|
|
|
2166
|
|
|
|
|
|
|
The log method returns the natural logarithm (base e) of the number. |
2167
|
|
|
|
|
|
|
|
2168
|
|
|
|
|
|
|
I> |
2169
|
|
|
|
|
|
|
|
2170
|
|
|
|
|
|
|
=over 4 |
2171
|
|
|
|
|
|
|
|
2172
|
|
|
|
|
|
|
=item log example 1 |
2173
|
|
|
|
|
|
|
|
2174
|
|
|
|
|
|
|
package main; |
2175
|
|
|
|
|
|
|
|
2176
|
|
|
|
|
|
|
use Venus::Number; |
2177
|
|
|
|
|
|
|
|
2178
|
|
|
|
|
|
|
my $number = Venus::Number->new(12345); |
2179
|
|
|
|
|
|
|
|
2180
|
|
|
|
|
|
|
my $log = $number->log; |
2181
|
|
|
|
|
|
|
|
2182
|
|
|
|
|
|
|
# 9.42100640177928 |
2183
|
|
|
|
|
|
|
|
2184
|
|
|
|
|
|
|
=back |
2185
|
|
|
|
|
|
|
|
2186
|
|
|
|
|
|
|
=cut |
2187
|
|
|
|
|
|
|
|
2188
|
|
|
|
|
|
|
=head2 lshift |
2189
|
|
|
|
|
|
|
|
2190
|
|
|
|
|
|
|
lshift(Num $value) (Num) |
2191
|
|
|
|
|
|
|
|
2192
|
|
|
|
|
|
|
The lshift method returns the result of a left shift performed on the argument |
2193
|
|
|
|
|
|
|
provided. |
2194
|
|
|
|
|
|
|
|
2195
|
|
|
|
|
|
|
I> |
2196
|
|
|
|
|
|
|
|
2197
|
|
|
|
|
|
|
=over 4 |
2198
|
|
|
|
|
|
|
|
2199
|
|
|
|
|
|
|
=item lshift example 1 |
2200
|
|
|
|
|
|
|
|
2201
|
|
|
|
|
|
|
# given: synopsis; |
2202
|
|
|
|
|
|
|
|
2203
|
|
|
|
|
|
|
my $lshift = $number->lshift(2); |
2204
|
|
|
|
|
|
|
|
2205
|
|
|
|
|
|
|
# 4000 |
2206
|
|
|
|
|
|
|
|
2207
|
|
|
|
|
|
|
=back |
2208
|
|
|
|
|
|
|
|
2209
|
|
|
|
|
|
|
=cut |
2210
|
|
|
|
|
|
|
|
2211
|
|
|
|
|
|
|
=head2 lt |
2212
|
|
|
|
|
|
|
|
2213
|
|
|
|
|
|
|
lt(any $arg) (boolean) |
2214
|
|
|
|
|
|
|
|
2215
|
|
|
|
|
|
|
The lt method performs a I<"lesser-than"> operation using the argument provided. |
2216
|
|
|
|
|
|
|
|
2217
|
|
|
|
|
|
|
I> |
2218
|
|
|
|
|
|
|
|
2219
|
|
|
|
|
|
|
=over 4 |
2220
|
|
|
|
|
|
|
|
2221
|
|
|
|
|
|
|
=item lt example 1 |
2222
|
|
|
|
|
|
|
|
2223
|
|
|
|
|
|
|
package main; |
2224
|
|
|
|
|
|
|
|
2225
|
|
|
|
|
|
|
use Venus::Array; |
2226
|
|
|
|
|
|
|
use Venus::Number; |
2227
|
|
|
|
|
|
|
|
2228
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2229
|
|
|
|
|
|
|
my $rvalue = Venus::Array->new; |
2230
|
|
|
|
|
|
|
|
2231
|
|
|
|
|
|
|
my $result = $lvalue->lt($rvalue); |
2232
|
|
|
|
|
|
|
|
2233
|
|
|
|
|
|
|
# 1 |
2234
|
|
|
|
|
|
|
|
2235
|
|
|
|
|
|
|
=back |
2236
|
|
|
|
|
|
|
|
2237
|
|
|
|
|
|
|
=over 4 |
2238
|
|
|
|
|
|
|
|
2239
|
|
|
|
|
|
|
=item lt example 2 |
2240
|
|
|
|
|
|
|
|
2241
|
|
|
|
|
|
|
package main; |
2242
|
|
|
|
|
|
|
|
2243
|
|
|
|
|
|
|
use Venus::Code; |
2244
|
|
|
|
|
|
|
use Venus::Number; |
2245
|
|
|
|
|
|
|
|
2246
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2247
|
|
|
|
|
|
|
my $rvalue = Venus::Code->new; |
2248
|
|
|
|
|
|
|
|
2249
|
|
|
|
|
|
|
my $result = $lvalue->lt($rvalue); |
2250
|
|
|
|
|
|
|
|
2251
|
|
|
|
|
|
|
# 1 |
2252
|
|
|
|
|
|
|
|
2253
|
|
|
|
|
|
|
=back |
2254
|
|
|
|
|
|
|
|
2255
|
|
|
|
|
|
|
=over 4 |
2256
|
|
|
|
|
|
|
|
2257
|
|
|
|
|
|
|
=item lt example 3 |
2258
|
|
|
|
|
|
|
|
2259
|
|
|
|
|
|
|
package main; |
2260
|
|
|
|
|
|
|
|
2261
|
|
|
|
|
|
|
use Venus::Float; |
2262
|
|
|
|
|
|
|
use Venus::Number; |
2263
|
|
|
|
|
|
|
|
2264
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2265
|
|
|
|
|
|
|
my $rvalue = Venus::Float->new; |
2266
|
|
|
|
|
|
|
|
2267
|
|
|
|
|
|
|
my $result = $lvalue->lt($rvalue); |
2268
|
|
|
|
|
|
|
|
2269
|
|
|
|
|
|
|
# 0 |
2270
|
|
|
|
|
|
|
|
2271
|
|
|
|
|
|
|
=back |
2272
|
|
|
|
|
|
|
|
2273
|
|
|
|
|
|
|
=over 4 |
2274
|
|
|
|
|
|
|
|
2275
|
|
|
|
|
|
|
=item lt example 4 |
2276
|
|
|
|
|
|
|
|
2277
|
|
|
|
|
|
|
package main; |
2278
|
|
|
|
|
|
|
|
2279
|
|
|
|
|
|
|
use Venus::Hash; |
2280
|
|
|
|
|
|
|
use Venus::Number; |
2281
|
|
|
|
|
|
|
|
2282
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2283
|
|
|
|
|
|
|
my $rvalue = Venus::Hash->new; |
2284
|
|
|
|
|
|
|
|
2285
|
|
|
|
|
|
|
my $result = $lvalue->lt($rvalue); |
2286
|
|
|
|
|
|
|
|
2287
|
|
|
|
|
|
|
# 1 |
2288
|
|
|
|
|
|
|
|
2289
|
|
|
|
|
|
|
=back |
2290
|
|
|
|
|
|
|
|
2291
|
|
|
|
|
|
|
=over 4 |
2292
|
|
|
|
|
|
|
|
2293
|
|
|
|
|
|
|
=item lt example 5 |
2294
|
|
|
|
|
|
|
|
2295
|
|
|
|
|
|
|
package main; |
2296
|
|
|
|
|
|
|
|
2297
|
|
|
|
|
|
|
use Venus::Number; |
2298
|
|
|
|
|
|
|
|
2299
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2300
|
|
|
|
|
|
|
my $rvalue = Venus::Number->new; |
2301
|
|
|
|
|
|
|
|
2302
|
|
|
|
|
|
|
my $result = $lvalue->lt($rvalue); |
2303
|
|
|
|
|
|
|
|
2304
|
|
|
|
|
|
|
# 0 |
2305
|
|
|
|
|
|
|
|
2306
|
|
|
|
|
|
|
=back |
2307
|
|
|
|
|
|
|
|
2308
|
|
|
|
|
|
|
=over 4 |
2309
|
|
|
|
|
|
|
|
2310
|
|
|
|
|
|
|
=item lt example 6 |
2311
|
|
|
|
|
|
|
|
2312
|
|
|
|
|
|
|
package main; |
2313
|
|
|
|
|
|
|
|
2314
|
|
|
|
|
|
|
use Venus::Number; |
2315
|
|
|
|
|
|
|
use Venus::Regexp; |
2316
|
|
|
|
|
|
|
|
2317
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2318
|
|
|
|
|
|
|
my $rvalue = Venus::Regexp->new; |
2319
|
|
|
|
|
|
|
|
2320
|
|
|
|
|
|
|
my $result = $lvalue->lt($rvalue); |
2321
|
|
|
|
|
|
|
|
2322
|
|
|
|
|
|
|
# 1 |
2323
|
|
|
|
|
|
|
|
2324
|
|
|
|
|
|
|
=back |
2325
|
|
|
|
|
|
|
|
2326
|
|
|
|
|
|
|
=over 4 |
2327
|
|
|
|
|
|
|
|
2328
|
|
|
|
|
|
|
=item lt example 7 |
2329
|
|
|
|
|
|
|
|
2330
|
|
|
|
|
|
|
package main; |
2331
|
|
|
|
|
|
|
|
2332
|
|
|
|
|
|
|
use Venus::Number; |
2333
|
|
|
|
|
|
|
use Venus::Scalar; |
2334
|
|
|
|
|
|
|
|
2335
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2336
|
|
|
|
|
|
|
my $rvalue = Venus::Scalar->new; |
2337
|
|
|
|
|
|
|
|
2338
|
|
|
|
|
|
|
my $result = $lvalue->lt($rvalue); |
2339
|
|
|
|
|
|
|
|
2340
|
|
|
|
|
|
|
# 1 |
2341
|
|
|
|
|
|
|
|
2342
|
|
|
|
|
|
|
=back |
2343
|
|
|
|
|
|
|
|
2344
|
|
|
|
|
|
|
=over 4 |
2345
|
|
|
|
|
|
|
|
2346
|
|
|
|
|
|
|
=item lt example 8 |
2347
|
|
|
|
|
|
|
|
2348
|
|
|
|
|
|
|
package main; |
2349
|
|
|
|
|
|
|
|
2350
|
|
|
|
|
|
|
use Venus::Number; |
2351
|
|
|
|
|
|
|
use Venus::String; |
2352
|
|
|
|
|
|
|
|
2353
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2354
|
|
|
|
|
|
|
my $rvalue = Venus::String->new; |
2355
|
|
|
|
|
|
|
|
2356
|
|
|
|
|
|
|
my $result = $lvalue->lt($rvalue); |
2357
|
|
|
|
|
|
|
|
2358
|
|
|
|
|
|
|
# 0 |
2359
|
|
|
|
|
|
|
|
2360
|
|
|
|
|
|
|
=back |
2361
|
|
|
|
|
|
|
|
2362
|
|
|
|
|
|
|
=over 4 |
2363
|
|
|
|
|
|
|
|
2364
|
|
|
|
|
|
|
=item lt example 9 |
2365
|
|
|
|
|
|
|
|
2366
|
|
|
|
|
|
|
package main; |
2367
|
|
|
|
|
|
|
|
2368
|
|
|
|
|
|
|
use Venus::Number; |
2369
|
|
|
|
|
|
|
use Venus::Undef; |
2370
|
|
|
|
|
|
|
|
2371
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2372
|
|
|
|
|
|
|
my $rvalue = Venus::Undef->new; |
2373
|
|
|
|
|
|
|
|
2374
|
|
|
|
|
|
|
my $result = $lvalue->lt($rvalue); |
2375
|
|
|
|
|
|
|
|
2376
|
|
|
|
|
|
|
# 0 |
2377
|
|
|
|
|
|
|
|
2378
|
|
|
|
|
|
|
=back |
2379
|
|
|
|
|
|
|
|
2380
|
|
|
|
|
|
|
=cut |
2381
|
|
|
|
|
|
|
|
2382
|
|
|
|
|
|
|
=head2 mod |
2383
|
|
|
|
|
|
|
|
2384
|
|
|
|
|
|
|
mod() (Num) |
2385
|
|
|
|
|
|
|
|
2386
|
|
|
|
|
|
|
The mod method returns the division remainder of the number divided by the |
2387
|
|
|
|
|
|
|
argment. |
2388
|
|
|
|
|
|
|
|
2389
|
|
|
|
|
|
|
I> |
2390
|
|
|
|
|
|
|
|
2391
|
|
|
|
|
|
|
=over 4 |
2392
|
|
|
|
|
|
|
|
2393
|
|
|
|
|
|
|
=item mod example 1 |
2394
|
|
|
|
|
|
|
|
2395
|
|
|
|
|
|
|
package main; |
2396
|
|
|
|
|
|
|
|
2397
|
|
|
|
|
|
|
use Venus::Number; |
2398
|
|
|
|
|
|
|
|
2399
|
|
|
|
|
|
|
my $number = Venus::Number->new(12); |
2400
|
|
|
|
|
|
|
|
2401
|
|
|
|
|
|
|
my $mod = $number->mod(1); |
2402
|
|
|
|
|
|
|
|
2403
|
|
|
|
|
|
|
# 0 |
2404
|
|
|
|
|
|
|
|
2405
|
|
|
|
|
|
|
=back |
2406
|
|
|
|
|
|
|
|
2407
|
|
|
|
|
|
|
=over 4 |
2408
|
|
|
|
|
|
|
|
2409
|
|
|
|
|
|
|
=item mod example 2 |
2410
|
|
|
|
|
|
|
|
2411
|
|
|
|
|
|
|
package main; |
2412
|
|
|
|
|
|
|
|
2413
|
|
|
|
|
|
|
use Venus::Number; |
2414
|
|
|
|
|
|
|
|
2415
|
|
|
|
|
|
|
my $number = Venus::Number->new(12); |
2416
|
|
|
|
|
|
|
|
2417
|
|
|
|
|
|
|
my $mod = $number->mod(2); |
2418
|
|
|
|
|
|
|
|
2419
|
|
|
|
|
|
|
# 0 |
2420
|
|
|
|
|
|
|
|
2421
|
|
|
|
|
|
|
=back |
2422
|
|
|
|
|
|
|
|
2423
|
|
|
|
|
|
|
=over 4 |
2424
|
|
|
|
|
|
|
|
2425
|
|
|
|
|
|
|
=item mod example 3 |
2426
|
|
|
|
|
|
|
|
2427
|
|
|
|
|
|
|
package main; |
2428
|
|
|
|
|
|
|
|
2429
|
|
|
|
|
|
|
use Venus::Number; |
2430
|
|
|
|
|
|
|
|
2431
|
|
|
|
|
|
|
my $number = Venus::Number->new(12); |
2432
|
|
|
|
|
|
|
|
2433
|
|
|
|
|
|
|
my $mod = $number->mod(5); |
2434
|
|
|
|
|
|
|
|
2435
|
|
|
|
|
|
|
# 2 |
2436
|
|
|
|
|
|
|
|
2437
|
|
|
|
|
|
|
=back |
2438
|
|
|
|
|
|
|
|
2439
|
|
|
|
|
|
|
=cut |
2440
|
|
|
|
|
|
|
|
2441
|
|
|
|
|
|
|
=head2 multi |
2442
|
|
|
|
|
|
|
|
2443
|
|
|
|
|
|
|
multi(Num $value) (Num) |
2444
|
|
|
|
|
|
|
|
2445
|
|
|
|
|
|
|
The multi method returns the result multiplication performed on the argument |
2446
|
|
|
|
|
|
|
provided. |
2447
|
|
|
|
|
|
|
|
2448
|
|
|
|
|
|
|
I> |
2449
|
|
|
|
|
|
|
|
2450
|
|
|
|
|
|
|
=over 4 |
2451
|
|
|
|
|
|
|
|
2452
|
|
|
|
|
|
|
=item multi example 1 |
2453
|
|
|
|
|
|
|
|
2454
|
|
|
|
|
|
|
# given: synopsis; |
2455
|
|
|
|
|
|
|
|
2456
|
|
|
|
|
|
|
my $multi = $number->multi(2); |
2457
|
|
|
|
|
|
|
|
2458
|
|
|
|
|
|
|
# 2000 |
2459
|
|
|
|
|
|
|
|
2460
|
|
|
|
|
|
|
=back |
2461
|
|
|
|
|
|
|
|
2462
|
|
|
|
|
|
|
=cut |
2463
|
|
|
|
|
|
|
|
2464
|
|
|
|
|
|
|
=head2 ne |
2465
|
|
|
|
|
|
|
|
2466
|
|
|
|
|
|
|
ne(any $arg) (boolean) |
2467
|
|
|
|
|
|
|
|
2468
|
|
|
|
|
|
|
The ne method performs a I<"not-equal-to"> operation using the argument provided. |
2469
|
|
|
|
|
|
|
|
2470
|
|
|
|
|
|
|
I> |
2471
|
|
|
|
|
|
|
|
2472
|
|
|
|
|
|
|
=over 4 |
2473
|
|
|
|
|
|
|
|
2474
|
|
|
|
|
|
|
=item ne example 1 |
2475
|
|
|
|
|
|
|
|
2476
|
|
|
|
|
|
|
package main; |
2477
|
|
|
|
|
|
|
|
2478
|
|
|
|
|
|
|
use Venus::Array; |
2479
|
|
|
|
|
|
|
use Venus::Number; |
2480
|
|
|
|
|
|
|
|
2481
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2482
|
|
|
|
|
|
|
my $rvalue = Venus::Array->new; |
2483
|
|
|
|
|
|
|
|
2484
|
|
|
|
|
|
|
my $result = $lvalue->ne($rvalue); |
2485
|
|
|
|
|
|
|
|
2486
|
|
|
|
|
|
|
# 1 |
2487
|
|
|
|
|
|
|
|
2488
|
|
|
|
|
|
|
=back |
2489
|
|
|
|
|
|
|
|
2490
|
|
|
|
|
|
|
=over 4 |
2491
|
|
|
|
|
|
|
|
2492
|
|
|
|
|
|
|
=item ne example 2 |
2493
|
|
|
|
|
|
|
|
2494
|
|
|
|
|
|
|
package main; |
2495
|
|
|
|
|
|
|
|
2496
|
|
|
|
|
|
|
use Venus::Code; |
2497
|
|
|
|
|
|
|
use Venus::Number; |
2498
|
|
|
|
|
|
|
|
2499
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2500
|
|
|
|
|
|
|
my $rvalue = Venus::Code->new; |
2501
|
|
|
|
|
|
|
|
2502
|
|
|
|
|
|
|
my $result = $lvalue->ne($rvalue); |
2503
|
|
|
|
|
|
|
|
2504
|
|
|
|
|
|
|
# 1 |
2505
|
|
|
|
|
|
|
|
2506
|
|
|
|
|
|
|
=back |
2507
|
|
|
|
|
|
|
|
2508
|
|
|
|
|
|
|
=over 4 |
2509
|
|
|
|
|
|
|
|
2510
|
|
|
|
|
|
|
=item ne example 3 |
2511
|
|
|
|
|
|
|
|
2512
|
|
|
|
|
|
|
package main; |
2513
|
|
|
|
|
|
|
|
2514
|
|
|
|
|
|
|
use Venus::Float; |
2515
|
|
|
|
|
|
|
use Venus::Number; |
2516
|
|
|
|
|
|
|
|
2517
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2518
|
|
|
|
|
|
|
my $rvalue = Venus::Float->new; |
2519
|
|
|
|
|
|
|
|
2520
|
|
|
|
|
|
|
my $result = $lvalue->ne($rvalue); |
2521
|
|
|
|
|
|
|
|
2522
|
|
|
|
|
|
|
# 0 |
2523
|
|
|
|
|
|
|
|
2524
|
|
|
|
|
|
|
=back |
2525
|
|
|
|
|
|
|
|
2526
|
|
|
|
|
|
|
=over 4 |
2527
|
|
|
|
|
|
|
|
2528
|
|
|
|
|
|
|
=item ne example 4 |
2529
|
|
|
|
|
|
|
|
2530
|
|
|
|
|
|
|
package main; |
2531
|
|
|
|
|
|
|
|
2532
|
|
|
|
|
|
|
use Venus::Hash; |
2533
|
|
|
|
|
|
|
use Venus::Number; |
2534
|
|
|
|
|
|
|
|
2535
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2536
|
|
|
|
|
|
|
my $rvalue = Venus::Hash->new; |
2537
|
|
|
|
|
|
|
|
2538
|
|
|
|
|
|
|
my $result = $lvalue->ne($rvalue); |
2539
|
|
|
|
|
|
|
|
2540
|
|
|
|
|
|
|
# 1 |
2541
|
|
|
|
|
|
|
|
2542
|
|
|
|
|
|
|
=back |
2543
|
|
|
|
|
|
|
|
2544
|
|
|
|
|
|
|
=over 4 |
2545
|
|
|
|
|
|
|
|
2546
|
|
|
|
|
|
|
=item ne example 5 |
2547
|
|
|
|
|
|
|
|
2548
|
|
|
|
|
|
|
package main; |
2549
|
|
|
|
|
|
|
|
2550
|
|
|
|
|
|
|
use Venus::Number; |
2551
|
|
|
|
|
|
|
|
2552
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2553
|
|
|
|
|
|
|
my $rvalue = Venus::Number->new; |
2554
|
|
|
|
|
|
|
|
2555
|
|
|
|
|
|
|
my $result = $lvalue->ne($rvalue); |
2556
|
|
|
|
|
|
|
|
2557
|
|
|
|
|
|
|
# 0 |
2558
|
|
|
|
|
|
|
|
2559
|
|
|
|
|
|
|
=back |
2560
|
|
|
|
|
|
|
|
2561
|
|
|
|
|
|
|
=over 4 |
2562
|
|
|
|
|
|
|
|
2563
|
|
|
|
|
|
|
=item ne example 6 |
2564
|
|
|
|
|
|
|
|
2565
|
|
|
|
|
|
|
package main; |
2566
|
|
|
|
|
|
|
|
2567
|
|
|
|
|
|
|
use Venus::Number; |
2568
|
|
|
|
|
|
|
use Venus::Regexp; |
2569
|
|
|
|
|
|
|
|
2570
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2571
|
|
|
|
|
|
|
my $rvalue = Venus::Regexp->new; |
2572
|
|
|
|
|
|
|
|
2573
|
|
|
|
|
|
|
my $result = $lvalue->ne($rvalue); |
2574
|
|
|
|
|
|
|
|
2575
|
|
|
|
|
|
|
# 1 |
2576
|
|
|
|
|
|
|
|
2577
|
|
|
|
|
|
|
=back |
2578
|
|
|
|
|
|
|
|
2579
|
|
|
|
|
|
|
=over 4 |
2580
|
|
|
|
|
|
|
|
2581
|
|
|
|
|
|
|
=item ne example 7 |
2582
|
|
|
|
|
|
|
|
2583
|
|
|
|
|
|
|
package main; |
2584
|
|
|
|
|
|
|
|
2585
|
|
|
|
|
|
|
use Venus::Number; |
2586
|
|
|
|
|
|
|
use Venus::Scalar; |
2587
|
|
|
|
|
|
|
|
2588
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2589
|
|
|
|
|
|
|
my $rvalue = Venus::Scalar->new; |
2590
|
|
|
|
|
|
|
|
2591
|
|
|
|
|
|
|
my $result = $lvalue->ne($rvalue); |
2592
|
|
|
|
|
|
|
|
2593
|
|
|
|
|
|
|
# 1 |
2594
|
|
|
|
|
|
|
|
2595
|
|
|
|
|
|
|
=back |
2596
|
|
|
|
|
|
|
|
2597
|
|
|
|
|
|
|
=over 4 |
2598
|
|
|
|
|
|
|
|
2599
|
|
|
|
|
|
|
=item ne example 8 |
2600
|
|
|
|
|
|
|
|
2601
|
|
|
|
|
|
|
package main; |
2602
|
|
|
|
|
|
|
|
2603
|
|
|
|
|
|
|
use Venus::Number; |
2604
|
|
|
|
|
|
|
use Venus::String; |
2605
|
|
|
|
|
|
|
|
2606
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2607
|
|
|
|
|
|
|
my $rvalue = Venus::String->new; |
2608
|
|
|
|
|
|
|
|
2609
|
|
|
|
|
|
|
my $result = $lvalue->ne($rvalue); |
2610
|
|
|
|
|
|
|
|
2611
|
|
|
|
|
|
|
# 0 |
2612
|
|
|
|
|
|
|
|
2613
|
|
|
|
|
|
|
=back |
2614
|
|
|
|
|
|
|
|
2615
|
|
|
|
|
|
|
=over 4 |
2616
|
|
|
|
|
|
|
|
2617
|
|
|
|
|
|
|
=item ne example 9 |
2618
|
|
|
|
|
|
|
|
2619
|
|
|
|
|
|
|
package main; |
2620
|
|
|
|
|
|
|
|
2621
|
|
|
|
|
|
|
use Venus::Number; |
2622
|
|
|
|
|
|
|
use Venus::Undef; |
2623
|
|
|
|
|
|
|
|
2624
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
2625
|
|
|
|
|
|
|
my $rvalue = Venus::Undef->new; |
2626
|
|
|
|
|
|
|
|
2627
|
|
|
|
|
|
|
my $result = $lvalue->ne($rvalue); |
2628
|
|
|
|
|
|
|
|
2629
|
|
|
|
|
|
|
# 0 |
2630
|
|
|
|
|
|
|
|
2631
|
|
|
|
|
|
|
=back |
2632
|
|
|
|
|
|
|
|
2633
|
|
|
|
|
|
|
=cut |
2634
|
|
|
|
|
|
|
|
2635
|
|
|
|
|
|
|
=head2 neg |
2636
|
|
|
|
|
|
|
|
2637
|
|
|
|
|
|
|
neg() (Num) |
2638
|
|
|
|
|
|
|
|
2639
|
|
|
|
|
|
|
The neg method returns a negative version of the number. |
2640
|
|
|
|
|
|
|
|
2641
|
|
|
|
|
|
|
I> |
2642
|
|
|
|
|
|
|
|
2643
|
|
|
|
|
|
|
=over 4 |
2644
|
|
|
|
|
|
|
|
2645
|
|
|
|
|
|
|
=item neg example 1 |
2646
|
|
|
|
|
|
|
|
2647
|
|
|
|
|
|
|
package main; |
2648
|
|
|
|
|
|
|
|
2649
|
|
|
|
|
|
|
use Venus::Number; |
2650
|
|
|
|
|
|
|
|
2651
|
|
|
|
|
|
|
my $number = Venus::Number->new(12345); |
2652
|
|
|
|
|
|
|
|
2653
|
|
|
|
|
|
|
my $neg = $number->neg; |
2654
|
|
|
|
|
|
|
|
2655
|
|
|
|
|
|
|
# -12345 |
2656
|
|
|
|
|
|
|
|
2657
|
|
|
|
|
|
|
=back |
2658
|
|
|
|
|
|
|
|
2659
|
|
|
|
|
|
|
=cut |
2660
|
|
|
|
|
|
|
|
2661
|
|
|
|
|
|
|
=head2 numified |
2662
|
|
|
|
|
|
|
|
2663
|
|
|
|
|
|
|
numified() (Num) |
2664
|
|
|
|
|
|
|
|
2665
|
|
|
|
|
|
|
The numified method returns the numerical representation of the object. For |
2666
|
|
|
|
|
|
|
number objects this method returns the object's underlying value. |
2667
|
|
|
|
|
|
|
|
2668
|
|
|
|
|
|
|
I> |
2669
|
|
|
|
|
|
|
|
2670
|
|
|
|
|
|
|
=over 4 |
2671
|
|
|
|
|
|
|
|
2672
|
|
|
|
|
|
|
=item numified example 1 |
2673
|
|
|
|
|
|
|
|
2674
|
|
|
|
|
|
|
# given: synopsis; |
2675
|
|
|
|
|
|
|
|
2676
|
|
|
|
|
|
|
my $numified = $number->numified; |
2677
|
|
|
|
|
|
|
|
2678
|
|
|
|
|
|
|
# 1000 |
2679
|
|
|
|
|
|
|
|
2680
|
|
|
|
|
|
|
=back |
2681
|
|
|
|
|
|
|
|
2682
|
|
|
|
|
|
|
=over 4 |
2683
|
|
|
|
|
|
|
|
2684
|
|
|
|
|
|
|
=item numified example 2 |
2685
|
|
|
|
|
|
|
|
2686
|
|
|
|
|
|
|
package main; |
2687
|
|
|
|
|
|
|
|
2688
|
|
|
|
|
|
|
use Venus::Number; |
2689
|
|
|
|
|
|
|
|
2690
|
|
|
|
|
|
|
my $number = Venus::Number->new(2_000); |
2691
|
|
|
|
|
|
|
|
2692
|
|
|
|
|
|
|
my $numified = $number->numified; |
2693
|
|
|
|
|
|
|
|
2694
|
|
|
|
|
|
|
# 2000 |
2695
|
|
|
|
|
|
|
|
2696
|
|
|
|
|
|
|
=back |
2697
|
|
|
|
|
|
|
|
2698
|
|
|
|
|
|
|
=over 4 |
2699
|
|
|
|
|
|
|
|
2700
|
|
|
|
|
|
|
=item numified example 3 |
2701
|
|
|
|
|
|
|
|
2702
|
|
|
|
|
|
|
package main; |
2703
|
|
|
|
|
|
|
|
2704
|
|
|
|
|
|
|
use Venus::Number; |
2705
|
|
|
|
|
|
|
|
2706
|
|
|
|
|
|
|
my $number = Venus::Number->new(10_000); |
2707
|
|
|
|
|
|
|
|
2708
|
|
|
|
|
|
|
my $numified = $number->numified; |
2709
|
|
|
|
|
|
|
|
2710
|
|
|
|
|
|
|
# 10000 |
2711
|
|
|
|
|
|
|
|
2712
|
|
|
|
|
|
|
=back |
2713
|
|
|
|
|
|
|
|
2714
|
|
|
|
|
|
|
=cut |
2715
|
|
|
|
|
|
|
|
2716
|
|
|
|
|
|
|
=head2 pow |
2717
|
|
|
|
|
|
|
|
2718
|
|
|
|
|
|
|
pow() (Num) |
2719
|
|
|
|
|
|
|
|
2720
|
|
|
|
|
|
|
The pow method returns a number, the result of a math operation, which is the |
2721
|
|
|
|
|
|
|
number to the power of the argument. |
2722
|
|
|
|
|
|
|
|
2723
|
|
|
|
|
|
|
I> |
2724
|
|
|
|
|
|
|
|
2725
|
|
|
|
|
|
|
=over 4 |
2726
|
|
|
|
|
|
|
|
2727
|
|
|
|
|
|
|
=item pow example 1 |
2728
|
|
|
|
|
|
|
|
2729
|
|
|
|
|
|
|
package main; |
2730
|
|
|
|
|
|
|
|
2731
|
|
|
|
|
|
|
use Venus::Number; |
2732
|
|
|
|
|
|
|
|
2733
|
|
|
|
|
|
|
my $number = Venus::Number->new(12345); |
2734
|
|
|
|
|
|
|
|
2735
|
|
|
|
|
|
|
my $pow = $number->pow(3); |
2736
|
|
|
|
|
|
|
|
2737
|
|
|
|
|
|
|
# 1881365963625 |
2738
|
|
|
|
|
|
|
|
2739
|
|
|
|
|
|
|
=back |
2740
|
|
|
|
|
|
|
|
2741
|
|
|
|
|
|
|
=cut |
2742
|
|
|
|
|
|
|
|
2743
|
|
|
|
|
|
|
=head2 prepend |
2744
|
|
|
|
|
|
|
|
2745
|
|
|
|
|
|
|
prepend(string @parts) (string) |
2746
|
|
|
|
|
|
|
|
2747
|
|
|
|
|
|
|
The prepend method prepends arugments to the number. |
2748
|
|
|
|
|
|
|
|
2749
|
|
|
|
|
|
|
I> |
2750
|
|
|
|
|
|
|
|
2751
|
|
|
|
|
|
|
=over 4 |
2752
|
|
|
|
|
|
|
|
2753
|
|
|
|
|
|
|
=item prepend example 1 |
2754
|
|
|
|
|
|
|
|
2755
|
|
|
|
|
|
|
# given: synopsis; |
2756
|
|
|
|
|
|
|
|
2757
|
|
|
|
|
|
|
my $prepend = $number->prepend(1); |
2758
|
|
|
|
|
|
|
|
2759
|
|
|
|
|
|
|
# 11_000 |
2760
|
|
|
|
|
|
|
|
2761
|
|
|
|
|
|
|
=back |
2762
|
|
|
|
|
|
|
|
2763
|
|
|
|
|
|
|
=cut |
2764
|
|
|
|
|
|
|
|
2765
|
|
|
|
|
|
|
=head2 prepend_with |
2766
|
|
|
|
|
|
|
|
2767
|
|
|
|
|
|
|
prepend_with(string $delimiter, string @parts) (string) |
2768
|
|
|
|
|
|
|
|
2769
|
|
|
|
|
|
|
The prepend_with method prepends arugments to the number using the delimiter |
2770
|
|
|
|
|
|
|
provided. |
2771
|
|
|
|
|
|
|
|
2772
|
|
|
|
|
|
|
I> |
2773
|
|
|
|
|
|
|
|
2774
|
|
|
|
|
|
|
=over 4 |
2775
|
|
|
|
|
|
|
|
2776
|
|
|
|
|
|
|
=item prepend_with example 1 |
2777
|
|
|
|
|
|
|
|
2778
|
|
|
|
|
|
|
# given: synopsis; |
2779
|
|
|
|
|
|
|
|
2780
|
|
|
|
|
|
|
my $prepend = $number->prepend_with('.', '11'); |
2781
|
|
|
|
|
|
|
|
2782
|
|
|
|
|
|
|
# "11.1000" |
2783
|
|
|
|
|
|
|
|
2784
|
|
|
|
|
|
|
=back |
2785
|
|
|
|
|
|
|
|
2786
|
|
|
|
|
|
|
=cut |
2787
|
|
|
|
|
|
|
|
2788
|
|
|
|
|
|
|
=head2 range |
2789
|
|
|
|
|
|
|
|
2790
|
|
|
|
|
|
|
range() (arrayref) |
2791
|
|
|
|
|
|
|
|
2792
|
|
|
|
|
|
|
The range method returns an array reference containing integer increasing values |
2793
|
|
|
|
|
|
|
up-to or down-to the limit specified. |
2794
|
|
|
|
|
|
|
|
2795
|
|
|
|
|
|
|
I> |
2796
|
|
|
|
|
|
|
|
2797
|
|
|
|
|
|
|
=over 4 |
2798
|
|
|
|
|
|
|
|
2799
|
|
|
|
|
|
|
=item range example 1 |
2800
|
|
|
|
|
|
|
|
2801
|
|
|
|
|
|
|
package main; |
2802
|
|
|
|
|
|
|
|
2803
|
|
|
|
|
|
|
use Venus::Number; |
2804
|
|
|
|
|
|
|
|
2805
|
|
|
|
|
|
|
my $number = Venus::Number->new(5); |
2806
|
|
|
|
|
|
|
|
2807
|
|
|
|
|
|
|
my $range = $number->range(9); |
2808
|
|
|
|
|
|
|
|
2809
|
|
|
|
|
|
|
# [5..9] |
2810
|
|
|
|
|
|
|
|
2811
|
|
|
|
|
|
|
=back |
2812
|
|
|
|
|
|
|
|
2813
|
|
|
|
|
|
|
=over 4 |
2814
|
|
|
|
|
|
|
|
2815
|
|
|
|
|
|
|
=item range example 2 |
2816
|
|
|
|
|
|
|
|
2817
|
|
|
|
|
|
|
package main; |
2818
|
|
|
|
|
|
|
|
2819
|
|
|
|
|
|
|
use Venus::Number; |
2820
|
|
|
|
|
|
|
|
2821
|
|
|
|
|
|
|
my $number = Venus::Number->new(5); |
2822
|
|
|
|
|
|
|
|
2823
|
|
|
|
|
|
|
my $range = $number->range(1); |
2824
|
|
|
|
|
|
|
|
2825
|
|
|
|
|
|
|
# [5, 4, 3, 2, 1] |
2826
|
|
|
|
|
|
|
|
2827
|
|
|
|
|
|
|
=back |
2828
|
|
|
|
|
|
|
|
2829
|
|
|
|
|
|
|
=cut |
2830
|
|
|
|
|
|
|
|
2831
|
|
|
|
|
|
|
=head2 repeat |
2832
|
|
|
|
|
|
|
|
2833
|
|
|
|
|
|
|
repeat(Num $number, string $delimiter) (string) |
2834
|
|
|
|
|
|
|
|
2835
|
|
|
|
|
|
|
The repeat method repeats the number value N times based on the argument provided |
2836
|
|
|
|
|
|
|
and returns a new concatenated number. Optionally, a delimiter can be provided |
2837
|
|
|
|
|
|
|
and be place between the occurences. |
2838
|
|
|
|
|
|
|
|
2839
|
|
|
|
|
|
|
I> |
2840
|
|
|
|
|
|
|
|
2841
|
|
|
|
|
|
|
=over 4 |
2842
|
|
|
|
|
|
|
|
2843
|
|
|
|
|
|
|
=item repeat example 1 |
2844
|
|
|
|
|
|
|
|
2845
|
|
|
|
|
|
|
package main; |
2846
|
|
|
|
|
|
|
|
2847
|
|
|
|
|
|
|
use Venus::Number; |
2848
|
|
|
|
|
|
|
|
2849
|
|
|
|
|
|
|
my $number = Venus::Number->new('999'); |
2850
|
|
|
|
|
|
|
|
2851
|
|
|
|
|
|
|
my $repeat = $number->repeat(2); |
2852
|
|
|
|
|
|
|
|
2853
|
|
|
|
|
|
|
# 999999 |
2854
|
|
|
|
|
|
|
|
2855
|
|
|
|
|
|
|
=back |
2856
|
|
|
|
|
|
|
|
2857
|
|
|
|
|
|
|
=over 4 |
2858
|
|
|
|
|
|
|
|
2859
|
|
|
|
|
|
|
=item repeat example 2 |
2860
|
|
|
|
|
|
|
|
2861
|
|
|
|
|
|
|
package main; |
2862
|
|
|
|
|
|
|
|
2863
|
|
|
|
|
|
|
use Venus::Number; |
2864
|
|
|
|
|
|
|
|
2865
|
|
|
|
|
|
|
my $number = Venus::Number->new('999'); |
2866
|
|
|
|
|
|
|
|
2867
|
|
|
|
|
|
|
my $repeat = $number->repeat(2, '.'); |
2868
|
|
|
|
|
|
|
|
2869
|
|
|
|
|
|
|
# 999.999 |
2870
|
|
|
|
|
|
|
|
2871
|
|
|
|
|
|
|
=back |
2872
|
|
|
|
|
|
|
|
2873
|
|
|
|
|
|
|
=cut |
2874
|
|
|
|
|
|
|
|
2875
|
|
|
|
|
|
|
=head2 rshift |
2876
|
|
|
|
|
|
|
|
2877
|
|
|
|
|
|
|
rshift(num $value) (Num) |
2878
|
|
|
|
|
|
|
|
2879
|
|
|
|
|
|
|
The rshift method returns the result a right shift performed on the argument |
2880
|
|
|
|
|
|
|
provided. |
2881
|
|
|
|
|
|
|
|
2882
|
|
|
|
|
|
|
I> |
2883
|
|
|
|
|
|
|
|
2884
|
|
|
|
|
|
|
=over 4 |
2885
|
|
|
|
|
|
|
|
2886
|
|
|
|
|
|
|
=item rshift example 1 |
2887
|
|
|
|
|
|
|
|
2888
|
|
|
|
|
|
|
# given: synopsis; |
2889
|
|
|
|
|
|
|
|
2890
|
|
|
|
|
|
|
my $rshift = $number->rshift(2); |
2891
|
|
|
|
|
|
|
|
2892
|
|
|
|
|
|
|
# 250 |
2893
|
|
|
|
|
|
|
|
2894
|
|
|
|
|
|
|
=back |
2895
|
|
|
|
|
|
|
|
2896
|
|
|
|
|
|
|
=cut |
2897
|
|
|
|
|
|
|
|
2898
|
|
|
|
|
|
|
=head2 sin |
2899
|
|
|
|
|
|
|
|
2900
|
|
|
|
|
|
|
sin() (Num) |
2901
|
|
|
|
|
|
|
|
2902
|
|
|
|
|
|
|
The sin method returns the sine of the number (expressed in radians). |
2903
|
|
|
|
|
|
|
|
2904
|
|
|
|
|
|
|
I> |
2905
|
|
|
|
|
|
|
|
2906
|
|
|
|
|
|
|
=over 4 |
2907
|
|
|
|
|
|
|
|
2908
|
|
|
|
|
|
|
=item sin example 1 |
2909
|
|
|
|
|
|
|
|
2910
|
|
|
|
|
|
|
package main; |
2911
|
|
|
|
|
|
|
|
2912
|
|
|
|
|
|
|
use Venus::Number; |
2913
|
|
|
|
|
|
|
|
2914
|
|
|
|
|
|
|
my $number = Venus::Number->new(12345); |
2915
|
|
|
|
|
|
|
|
2916
|
|
|
|
|
|
|
my $sin = $number->sin; |
2917
|
|
|
|
|
|
|
|
2918
|
|
|
|
|
|
|
# -0.993771636455681 |
2919
|
|
|
|
|
|
|
|
2920
|
|
|
|
|
|
|
=back |
2921
|
|
|
|
|
|
|
|
2922
|
|
|
|
|
|
|
=cut |
2923
|
|
|
|
|
|
|
|
2924
|
|
|
|
|
|
|
=head2 sqrt |
2925
|
|
|
|
|
|
|
|
2926
|
|
|
|
|
|
|
sqrt() (Num) |
2927
|
|
|
|
|
|
|
|
2928
|
|
|
|
|
|
|
The sqrt method returns the positive square root of the number. |
2929
|
|
|
|
|
|
|
|
2930
|
|
|
|
|
|
|
I> |
2931
|
|
|
|
|
|
|
|
2932
|
|
|
|
|
|
|
=over 4 |
2933
|
|
|
|
|
|
|
|
2934
|
|
|
|
|
|
|
=item sqrt example 1 |
2935
|
|
|
|
|
|
|
|
2936
|
|
|
|
|
|
|
package main; |
2937
|
|
|
|
|
|
|
|
2938
|
|
|
|
|
|
|
use Venus::Number; |
2939
|
|
|
|
|
|
|
|
2940
|
|
|
|
|
|
|
my $number = Venus::Number->new(12345); |
2941
|
|
|
|
|
|
|
|
2942
|
|
|
|
|
|
|
my $sqrt = $number->sqrt; |
2943
|
|
|
|
|
|
|
|
2944
|
|
|
|
|
|
|
# 111.108055513541 |
2945
|
|
|
|
|
|
|
|
2946
|
|
|
|
|
|
|
=back |
2947
|
|
|
|
|
|
|
|
2948
|
|
|
|
|
|
|
=cut |
2949
|
|
|
|
|
|
|
|
2950
|
|
|
|
|
|
|
=head2 sub |
2951
|
|
|
|
|
|
|
|
2952
|
|
|
|
|
|
|
sub(Num $value) (Num) |
2953
|
|
|
|
|
|
|
|
2954
|
|
|
|
|
|
|
The sub method returns the result subtraction performed on the argument |
2955
|
|
|
|
|
|
|
provided. |
2956
|
|
|
|
|
|
|
|
2957
|
|
|
|
|
|
|
I> |
2958
|
|
|
|
|
|
|
|
2959
|
|
|
|
|
|
|
=over 4 |
2960
|
|
|
|
|
|
|
|
2961
|
|
|
|
|
|
|
=item sub example 1 |
2962
|
|
|
|
|
|
|
|
2963
|
|
|
|
|
|
|
# given: synopsis; |
2964
|
|
|
|
|
|
|
|
2965
|
|
|
|
|
|
|
my $sub = $number->sub(500); |
2966
|
|
|
|
|
|
|
|
2967
|
|
|
|
|
|
|
# 500 |
2968
|
|
|
|
|
|
|
|
2969
|
|
|
|
|
|
|
=back |
2970
|
|
|
|
|
|
|
|
2971
|
|
|
|
|
|
|
=cut |
2972
|
|
|
|
|
|
|
|
2973
|
|
|
|
|
|
|
=head2 substr |
2974
|
|
|
|
|
|
|
|
2975
|
|
|
|
|
|
|
substr(Num $offset, Num $length, string $replace) (string) |
2976
|
|
|
|
|
|
|
|
2977
|
|
|
|
|
|
|
The substr method calls the core L function with the object's number |
2978
|
|
|
|
|
|
|
value. In list context returns the result and the subject. |
2979
|
|
|
|
|
|
|
|
2980
|
|
|
|
|
|
|
I> |
2981
|
|
|
|
|
|
|
|
2982
|
|
|
|
|
|
|
=over 4 |
2983
|
|
|
|
|
|
|
|
2984
|
|
|
|
|
|
|
=item substr example 1 |
2985
|
|
|
|
|
|
|
|
2986
|
|
|
|
|
|
|
package main; |
2987
|
|
|
|
|
|
|
|
2988
|
|
|
|
|
|
|
use Venus::Number; |
2989
|
|
|
|
|
|
|
|
2990
|
|
|
|
|
|
|
my $number = Venus::Number->new(1234567890); |
2991
|
|
|
|
|
|
|
|
2992
|
|
|
|
|
|
|
my $substr = $number->substr(0, 5); |
2993
|
|
|
|
|
|
|
|
2994
|
|
|
|
|
|
|
# 12345 |
2995
|
|
|
|
|
|
|
|
2996
|
|
|
|
|
|
|
=back |
2997
|
|
|
|
|
|
|
|
2998
|
|
|
|
|
|
|
=over 4 |
2999
|
|
|
|
|
|
|
|
3000
|
|
|
|
|
|
|
=item substr example 2 |
3001
|
|
|
|
|
|
|
|
3002
|
|
|
|
|
|
|
package main; |
3003
|
|
|
|
|
|
|
|
3004
|
|
|
|
|
|
|
use Venus::Number; |
3005
|
|
|
|
|
|
|
|
3006
|
|
|
|
|
|
|
my $number = Venus::Number->new(1234567890); |
3007
|
|
|
|
|
|
|
|
3008
|
|
|
|
|
|
|
my $substr = $number->substr(6, 5); |
3009
|
|
|
|
|
|
|
|
3010
|
|
|
|
|
|
|
# 7890 |
3011
|
|
|
|
|
|
|
|
3012
|
|
|
|
|
|
|
=back |
3013
|
|
|
|
|
|
|
|
3014
|
|
|
|
|
|
|
=over 4 |
3015
|
|
|
|
|
|
|
|
3016
|
|
|
|
|
|
|
=item substr example 3 |
3017
|
|
|
|
|
|
|
|
3018
|
|
|
|
|
|
|
package main; |
3019
|
|
|
|
|
|
|
|
3020
|
|
|
|
|
|
|
use Venus::Number; |
3021
|
|
|
|
|
|
|
|
3022
|
|
|
|
|
|
|
my $number = Venus::Number->new(1234567890); |
3023
|
|
|
|
|
|
|
|
3024
|
|
|
|
|
|
|
my $substr = $number->substr(6, 5, '0000'); |
3025
|
|
|
|
|
|
|
|
3026
|
|
|
|
|
|
|
# "1234560000" |
3027
|
|
|
|
|
|
|
|
3028
|
|
|
|
|
|
|
=back |
3029
|
|
|
|
|
|
|
|
3030
|
|
|
|
|
|
|
=over 4 |
3031
|
|
|
|
|
|
|
|
3032
|
|
|
|
|
|
|
=item substr example 4 |
3033
|
|
|
|
|
|
|
|
3034
|
|
|
|
|
|
|
package main; |
3035
|
|
|
|
|
|
|
|
3036
|
|
|
|
|
|
|
use Venus::Number; |
3037
|
|
|
|
|
|
|
|
3038
|
|
|
|
|
|
|
my $number = Venus::Number->new(1234567890); |
3039
|
|
|
|
|
|
|
|
3040
|
|
|
|
|
|
|
my ($result, $subject) = $number->substr(6, 5, '0000'); |
3041
|
|
|
|
|
|
|
|
3042
|
|
|
|
|
|
|
# ("789", "1234560000") |
3043
|
|
|
|
|
|
|
|
3044
|
|
|
|
|
|
|
=back |
3045
|
|
|
|
|
|
|
|
3046
|
|
|
|
|
|
|
=cut |
3047
|
|
|
|
|
|
|
|
3048
|
|
|
|
|
|
|
=head2 tv |
3049
|
|
|
|
|
|
|
|
3050
|
|
|
|
|
|
|
tv(any $arg) (boolean) |
3051
|
|
|
|
|
|
|
|
3052
|
|
|
|
|
|
|
The tv method performs a I<"type-and-value-equal-to"> operation using argument |
3053
|
|
|
|
|
|
|
provided. |
3054
|
|
|
|
|
|
|
|
3055
|
|
|
|
|
|
|
I> |
3056
|
|
|
|
|
|
|
|
3057
|
|
|
|
|
|
|
=over 4 |
3058
|
|
|
|
|
|
|
|
3059
|
|
|
|
|
|
|
=item tv example 1 |
3060
|
|
|
|
|
|
|
|
3061
|
|
|
|
|
|
|
package main; |
3062
|
|
|
|
|
|
|
|
3063
|
|
|
|
|
|
|
use Venus::Array; |
3064
|
|
|
|
|
|
|
use Venus::Number; |
3065
|
|
|
|
|
|
|
|
3066
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
3067
|
|
|
|
|
|
|
my $rvalue = Venus::Array->new; |
3068
|
|
|
|
|
|
|
|
3069
|
|
|
|
|
|
|
my $result = $lvalue->tv($rvalue); |
3070
|
|
|
|
|
|
|
|
3071
|
|
|
|
|
|
|
# 0 |
3072
|
|
|
|
|
|
|
|
3073
|
|
|
|
|
|
|
=back |
3074
|
|
|
|
|
|
|
|
3075
|
|
|
|
|
|
|
=over 4 |
3076
|
|
|
|
|
|
|
|
3077
|
|
|
|
|
|
|
=item tv example 2 |
3078
|
|
|
|
|
|
|
|
3079
|
|
|
|
|
|
|
package main; |
3080
|
|
|
|
|
|
|
|
3081
|
|
|
|
|
|
|
use Venus::Code; |
3082
|
|
|
|
|
|
|
use Venus::Number; |
3083
|
|
|
|
|
|
|
|
3084
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
3085
|
|
|
|
|
|
|
my $rvalue = Venus::Code->new; |
3086
|
|
|
|
|
|
|
|
3087
|
|
|
|
|
|
|
my $result = $lvalue->tv($rvalue); |
3088
|
|
|
|
|
|
|
|
3089
|
|
|
|
|
|
|
# 0 |
3090
|
|
|
|
|
|
|
|
3091
|
|
|
|
|
|
|
=back |
3092
|
|
|
|
|
|
|
|
3093
|
|
|
|
|
|
|
=over 4 |
3094
|
|
|
|
|
|
|
|
3095
|
|
|
|
|
|
|
=item tv example 3 |
3096
|
|
|
|
|
|
|
|
3097
|
|
|
|
|
|
|
package main; |
3098
|
|
|
|
|
|
|
|
3099
|
|
|
|
|
|
|
use Venus::Float; |
3100
|
|
|
|
|
|
|
use Venus::Number; |
3101
|
|
|
|
|
|
|
|
3102
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
3103
|
|
|
|
|
|
|
my $rvalue = Venus::Float->new; |
3104
|
|
|
|
|
|
|
|
3105
|
|
|
|
|
|
|
my $result = $lvalue->tv($rvalue); |
3106
|
|
|
|
|
|
|
|
3107
|
|
|
|
|
|
|
# 1 |
3108
|
|
|
|
|
|
|
|
3109
|
|
|
|
|
|
|
=back |
3110
|
|
|
|
|
|
|
|
3111
|
|
|
|
|
|
|
=over 4 |
3112
|
|
|
|
|
|
|
|
3113
|
|
|
|
|
|
|
=item tv example 4 |
3114
|
|
|
|
|
|
|
|
3115
|
|
|
|
|
|
|
package main; |
3116
|
|
|
|
|
|
|
|
3117
|
|
|
|
|
|
|
use Venus::Hash; |
3118
|
|
|
|
|
|
|
use Venus::Number; |
3119
|
|
|
|
|
|
|
|
3120
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
3121
|
|
|
|
|
|
|
my $rvalue = Venus::Hash->new; |
3122
|
|
|
|
|
|
|
|
3123
|
|
|
|
|
|
|
my $result = $lvalue->tv($rvalue); |
3124
|
|
|
|
|
|
|
|
3125
|
|
|
|
|
|
|
# 0 |
3126
|
|
|
|
|
|
|
|
3127
|
|
|
|
|
|
|
=back |
3128
|
|
|
|
|
|
|
|
3129
|
|
|
|
|
|
|
=over 4 |
3130
|
|
|
|
|
|
|
|
3131
|
|
|
|
|
|
|
=item tv example 5 |
3132
|
|
|
|
|
|
|
|
3133
|
|
|
|
|
|
|
package main; |
3134
|
|
|
|
|
|
|
|
3135
|
|
|
|
|
|
|
use Venus::Number; |
3136
|
|
|
|
|
|
|
|
3137
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
3138
|
|
|
|
|
|
|
my $rvalue = Venus::Number->new; |
3139
|
|
|
|
|
|
|
|
3140
|
|
|
|
|
|
|
my $result = $lvalue->tv($rvalue); |
3141
|
|
|
|
|
|
|
|
3142
|
|
|
|
|
|
|
# 1 |
3143
|
|
|
|
|
|
|
|
3144
|
|
|
|
|
|
|
=back |
3145
|
|
|
|
|
|
|
|
3146
|
|
|
|
|
|
|
=over 4 |
3147
|
|
|
|
|
|
|
|
3148
|
|
|
|
|
|
|
=item tv example 6 |
3149
|
|
|
|
|
|
|
|
3150
|
|
|
|
|
|
|
package main; |
3151
|
|
|
|
|
|
|
|
3152
|
|
|
|
|
|
|
use Venus::Number; |
3153
|
|
|
|
|
|
|
use Venus::Regexp; |
3154
|
|
|
|
|
|
|
|
3155
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
3156
|
|
|
|
|
|
|
my $rvalue = Venus::Regexp->new; |
3157
|
|
|
|
|
|
|
|
3158
|
|
|
|
|
|
|
my $result = $lvalue->tv($rvalue); |
3159
|
|
|
|
|
|
|
|
3160
|
|
|
|
|
|
|
# 0 |
3161
|
|
|
|
|
|
|
|
3162
|
|
|
|
|
|
|
=back |
3163
|
|
|
|
|
|
|
|
3164
|
|
|
|
|
|
|
=over 4 |
3165
|
|
|
|
|
|
|
|
3166
|
|
|
|
|
|
|
=item tv example 7 |
3167
|
|
|
|
|
|
|
|
3168
|
|
|
|
|
|
|
package main; |
3169
|
|
|
|
|
|
|
|
3170
|
|
|
|
|
|
|
use Venus::Number; |
3171
|
|
|
|
|
|
|
use Venus::Scalar; |
3172
|
|
|
|
|
|
|
|
3173
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
3174
|
|
|
|
|
|
|
my $rvalue = Venus::Scalar->new; |
3175
|
|
|
|
|
|
|
|
3176
|
|
|
|
|
|
|
my $result = $lvalue->tv($rvalue); |
3177
|
|
|
|
|
|
|
|
3178
|
|
|
|
|
|
|
# 0 |
3179
|
|
|
|
|
|
|
|
3180
|
|
|
|
|
|
|
=back |
3181
|
|
|
|
|
|
|
|
3182
|
|
|
|
|
|
|
=over 4 |
3183
|
|
|
|
|
|
|
|
3184
|
|
|
|
|
|
|
=item tv example 8 |
3185
|
|
|
|
|
|
|
|
3186
|
|
|
|
|
|
|
package main; |
3187
|
|
|
|
|
|
|
|
3188
|
|
|
|
|
|
|
use Venus::Number; |
3189
|
|
|
|
|
|
|
use Venus::String; |
3190
|
|
|
|
|
|
|
|
3191
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
3192
|
|
|
|
|
|
|
my $rvalue = Venus::String->new; |
3193
|
|
|
|
|
|
|
|
3194
|
|
|
|
|
|
|
my $result = $lvalue->tv($rvalue); |
3195
|
|
|
|
|
|
|
|
3196
|
|
|
|
|
|
|
# 0 |
3197
|
|
|
|
|
|
|
|
3198
|
|
|
|
|
|
|
=back |
3199
|
|
|
|
|
|
|
|
3200
|
|
|
|
|
|
|
=over 4 |
3201
|
|
|
|
|
|
|
|
3202
|
|
|
|
|
|
|
=item tv example 9 |
3203
|
|
|
|
|
|
|
|
3204
|
|
|
|
|
|
|
package main; |
3205
|
|
|
|
|
|
|
|
3206
|
|
|
|
|
|
|
use Venus::Number; |
3207
|
|
|
|
|
|
|
use Venus::Undef; |
3208
|
|
|
|
|
|
|
|
3209
|
|
|
|
|
|
|
my $lvalue = Venus::Number->new; |
3210
|
|
|
|
|
|
|
my $rvalue = Venus::Undef->new; |
3211
|
|
|
|
|
|
|
|
3212
|
|
|
|
|
|
|
my $result = $lvalue->tv($rvalue); |
3213
|
|
|
|
|
|
|
|
3214
|
|
|
|
|
|
|
# 0 |
3215
|
|
|
|
|
|
|
|
3216
|
|
|
|
|
|
|
=back |
3217
|
|
|
|
|
|
|
|
3218
|
|
|
|
|
|
|
=cut |
3219
|
|
|
|
|
|
|
|
3220
|
|
|
|
|
|
|
=head1 AUTHORS |
3221
|
|
|
|
|
|
|
|
3222
|
|
|
|
|
|
|
Awncorp, C |
3223
|
|
|
|
|
|
|
|
3224
|
|
|
|
|
|
|
=cut |
3225
|
|
|
|
|
|
|
|
3226
|
|
|
|
|
|
|
=head1 LICENSE |
3227
|
|
|
|
|
|
|
|
3228
|
|
|
|
|
|
|
Copyright (C) 2000, Awncorp, C. |
3229
|
|
|
|
|
|
|
|
3230
|
|
|
|
|
|
|
This program is free software, you can redistribute it and/or modify it under |
3231
|
|
|
|
|
|
|
the terms of the Apache license version 2.0. |
3232
|
|
|
|
|
|
|
|
3233
|
|
|
|
|
|
|
=cut |