BigFloat/Constant.pm

filter: Statementstmt 77.7% 21 / 27 Branchbran 33.3% 2 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 75.6% 31 / 41 CC 4 SCAR 10.6
CC
4
Cov
70%
modify
6.0
copy
2.0
BEGIN
1.0
CRAP 2.9
↑ Summary BigInt/Constant.pm »
1 # -*- mode: perl; -*-
2  
3 package Math::BigFloat::Constant;
4  
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 our $VERSION = '1.15';
9  
10 2 ▶use Math::BigFloat '1.999802';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 our @ISA = qw( Math::BigFloat );
12  
13 2 ▶use overload; # inherit from Math::BigFloat
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 ##############################################################################
16 # We Are a True Math::BigFloat, But Thou Shallst Not Modify Us
17  
18 sub modify {
19 35 ▶ my ($self, $method) = @_;
Subroutine modify: called CC=3 SCAR=17.9
Pod documented
20  
21 35 ▶ unless (defined $method) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $method) 0 35 35
22 0 my @callinfo = caller(0);
23 0 for (my $i = 1 ; ; ++$i) {
24 0 my @next = caller($i);
25 0 ▶ last unless @next;
Branch: 1 branch
BranchTrueFalseTotal
unless @next 0 0 0
26 0 @callinfo = @next;
27 }
28 0 $method = $callinfo[3];
29 }
30  
31 35 die("Can not modify ", ref($self), " $self via $method()\n");
32 }
33  
34 ##############################################################################
35 # But cloning us creates a modifyable Math::BigInt, so that overload works
36  
37 sub copy {
38 10 ▶ my $x = shift;
Subroutine copy: called CC=2 SCAR=7.1
Pod documented
39  
40 10 ▶ return Math::BigFloat->new($x) unless ref($x);
Branch: 1 branch
BranchTrueFalseTotal
unless ref $x 0 10 10
41 10 Math::BigFloat->copy($x);
42 }
43  
44 2 1;
45  
46 __END__
↑ Summary BigInt/Constant.pm »