blib/lib/Zuzu/Util/Number.pm

filter: Statementstmt 100% 17 / 17 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 1 totaltotal 96.3% 26 / 27 CC 4 SCAR 11.0
CC
4
Cov
100%
is_finite_number
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« blib/lib/Zuzu/Value/BinaryString.pm ↑ Summary blib/lib/Zuzu/Env.pm »
1 package Zuzu::Util::Number;
2  
3 9 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 9 our $VERSION = '0.007002';
6  
7 9 ▶use Exporter qw( import );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 9 our @EXPORT_OK = qw(
10 is_finite_number
11 );
12  
13 9 my $POSITIVE_INFINITY = 9**9**9;
14 9 my $NEGATIVE_INFINITY = -$POSITIVE_INFINITY;
15  
16 152 ▶sub is_finite_number {
Subroutine is_finite_number: called CC=4 SCAR=13.9
Pod undocumented
17 152 my ( $number ) = @_;
18  
19 152 $number = 0 + $number;
20 152 ▶ return 0 if $number != $number;
Branch: 1 branch
BranchTrueFalseTotal
if $number != $number 1 151 152
21 151 ▶ return 0 if $number == $POSITIVE_INFINITY;
Branch: 1 branch
BranchTrueFalseTotal
if $number == $POSITIVE_INFINITY 2 149 151
22 149 ▶ return 0 if $number == $NEGATIVE_INFINITY;
Branch: 1 branch
BranchTrueFalseTotal
if $number == $NEGATIVE_INFINITY 1 148 149
23 148 return 1;
24 }
25  
26 9 1;
27  
28 =pod
29  
30 =head1 COPYRIGHT AND LICENCE
31  
32 B<< Zuzu::Util::Number >> is copyright Toby Inkster.
33  
34 It is free software; you may redistribute it and/or modify it under
35 the terms of either the Artistic License 1.0 or the GNU General Public
36 License version 2.
37  
38 =cut
« blib/lib/Zuzu/Value/BinaryString.pm ↑ Summary blib/lib/Zuzu/Env.pm »