| 1 | package Util::Underscore::Numbers; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | #ABSTRACT: Functions for dealing with numbers | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 12 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 12 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 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 | ▶ | goto &Scalar::Util::looks_like_number; | ||||||||||||||||||||||||||
|
Subroutine
is_numeric: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | sub is_int(_) { | ||||||||||||||||||||||||||||
| 20 | ## no critic (ProhibitEnumeratedClasses) | ||||||||||||||||||||||||||||
| 21 | 14 | ▶ | defined $_[0] | ||||||||||||||||||||||||||
|
Subroutine
is_int: called CC=3 SCAR=11.0
Branch: 1 branch
Condition100%3/3
defined $_[0] and not defined &ref_type($_[0])
MC/DC100%2/2
defined $_[0] and not defined &ref_type($_[0])
defined $_[0]
not defined &ref_type($_[0])
Truth table100%3/3
A and not(B)
A= defined $_[0]B= not defined &ref_type($_[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 | ▶ | defined $_[0] | ||||||||||||||||||||||||||
|
Subroutine
is_uint: called CC=3 SCAR=11.0
Branch: 1 branch
Condition100%3/3
defined $_[0] and not defined &ref_type($_[0])
MC/DC100%2/2
defined $_[0] and not defined &ref_type($_[0])
defined $_[0]
not defined &ref_type($_[0])
Truth table100%3/3
A and not(B)
A= defined $_[0]B= not defined &ref_type($_[0])
| |||||||||||||||||||||||||||||
| 29 | && !defined ref_type $_[0] | ||||||||||||||||||||||||||||
| 30 | && scalar($_[0] =~ /\A [0-9]+ \z/xsm); | ||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | sub ceil(_) { | ||||||||||||||||||||||||||||
| 34 | 10 | ▶ | goto &POSIX::ceil; | ||||||||||||||||||||||||||
|
Subroutine
ceil: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | sub floor(_) { | ||||||||||||||||||||||||||||
| 38 | 10 | ▶ | goto &POSIX::floor; | ||||||||||||||||||||||||||
|
Subroutine
floor: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 12 | 1; | |||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | __END__ | ||||||||||||||||||||||||||||