Integer.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 100% 28 / 28 CC 2 SCAR 4.1
CC
2
Cov
100%
gcd
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« MVPoly.pm ↑ Summary
1 package Math::MVPoly::Integer;
2
3 # Copyright (c) 1998 by Brian Guarraci. All rights reserved.
4 # This program is free software; you can redistribute it and/or modify it
5 # under the same terms as Perl itself.
6
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Math::MVPoly::Monomial;
Subroutine BEGIN: called CC=1 SCAR=0.0
9
10 sub
11 gcd
12 144 ▶{
Subroutine gcd: called CC=2 SCAR=6.9
Pod documented
13 144 my $u;
14 my $v;
15 144 my $q;
16 144 my $t;
17 144 my $g;
18
19 144 my $a = $_[0];
20 144 my $b = $_[1];
21
22 144 $u = [1,0,abs($a)];
23 144 $v = [0,1,abs($b)];
24
25 144 ▶ while($$v[2])
Branch: 1 branch
BranchTrueFalseTotal
if ($v->[2]) 150 144 294
26 {
27 150 $q = int($$u[2]/$$v[2]);
28 150 $t = [ $$u[0] - $$v[0]*$q,
29 $$u[1] - $$v[1]*$q,
30 $$u[2] - $$v[2]*$q];
31 150 $u = $v;
32 150 $v = $t;
33 }
34
35 144 $g = $$u[2];
36
37 144 return $g;
38 }
39
40 1 1;
41
42 __END__
« MVPoly.pm ↑ Summary