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