line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Util::Underscore::Numbers; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
#ABSTRACT: Functions for dealing with numbers |
4
|
|
|
|
|
|
|
|
5
|
12
|
|
|
12
|
|
76
|
use strict; |
|
12
|
|
|
|
|
27
|
|
|
12
|
|
|
|
|
327
|
|
6
|
12
|
|
|
12
|
|
64
|
use warnings; |
|
12
|
|
|
|
|
25
|
|
|
12
|
|
|
|
|
2843
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
## no critic (ProhibitMultiplePackages) |
10
|
|
|
|
|
|
|
package # hide from PAUSE |
11
|
|
|
|
|
|
|
_; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
## no critic (RequireArgUnpacking, RequireFinalReturn, ProhibitSubroutinePrototypes) |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub is_numeric(_) { |
16
|
27
|
|
|
27
|
|
14377
|
goto &Scalar::Util::looks_like_number; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub is_int(_) { |
20
|
|
|
|
|
|
|
## no critic (ProhibitEnumeratedClasses) |
21
|
14
|
100
|
100
|
14
|
|
4306
|
defined $_[0] |
22
|
|
|
|
|
|
|
&& !defined ref_type $_[0] |
23
|
|
|
|
|
|
|
&& scalar($_[0] =~ /\A [-]? [0-9]+ \z/xsm); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub is_uint(_) { |
27
|
|
|
|
|
|
|
## no critic (ProhibitEnumeratedClasses) |
28
|
14
|
100
|
100
|
14
|
|
2547
|
defined $_[0] |
29
|
|
|
|
|
|
|
&& !defined ref_type $_[0] |
30
|
|
|
|
|
|
|
&& scalar($_[0] =~ /\A [0-9]+ \z/xsm); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub ceil(_) { |
34
|
10
|
|
|
10
|
|
1977
|
goto &POSIX::ceil; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub floor(_) { |
38
|
10
|
|
|
10
|
|
1800
|
goto &POSIX::floor; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |