Branch Coverage

blib/lib/Math/BigInt/Calc.pm
Criterion Covered Total %
branch 344 524 65.6


line true false branch
51 0 0 unless @_
55 0 0 if (@_ == 1)
57 0 0 unless defined $param and length $param
59 0 0 if $param eq "base_len"
60 0 0 if $param eq "use_int"
69 0 0 unless defined $param and length $param
71 0 0 unless @_
75 0 0 if ($param eq "base_len" or $param eq "use_int")
83 0 0 if exists $opts->{'base_len'}
84 0 0 if exists $opts->{'use_int'}
94 62 11 if (@_)
97 0 62 unless defined $base_len and $base_len == int $base_len and $base_len > 0
101 0 62 if ($use_int and $base_len > $MAX_EXP_I or not $use_int and $base_len > $MAX_EXP_F)
104 0 0 $use_int ? :
113 61 1 $use_int ? :
117 61 1 if ($use_int) { }
133 0 73 $umax < $BASE ? :
142 0 73 if $MAX_BITS > 32
151 0 0 unless $AND_BITS < $MAX_BITS and $x == $z and $y == $x
158 0 0 unless $XOR_BITS < $MAX_BITS and $x == $z and $y == $x
165 0 0 unless $OR_BITS < $MAX_BITS and $x == $z and $y == $x
172 67 6 unless wantarray
190 161451 27265 if $input_len < $BASE_LEN
193 0 27265 $] < 5.008 ? :
232 0 510 if $yn != $ys
236 51 459 if $rn != 1
240 0 459 if $cn != $cs
245 0 459 if $zn != $zs
246 0 459 if $zn - ($zn - 1) != 1
271 0 51 if $yn != $ys
275 0 51 if $rn != 1
279 0 51 if $cn != $cs
284 0 51 if $zn != $zs
285 0 51 if $zn - ($zn - 1) != 1
289 0 51 $MAX_EXP_F > $MAX_EXP_I ? :
318 0 29997 $BASE_LEN == 1 ? :
347 0 2 unless defined $param and length $param
349 0 2 unless @_
353 2 0 if ($param eq "base_len" or $param eq "use_int")
361 1 10 exists $opts->{'base_len'} ? :
362 1 10 exists $opts->{'use_int'} ? :
378 0 61653 if ($idx < 0)
384 27502 34151 if ($idx > 0)
399 74807 16 if @$x == 1
428 6871 48411 if @$y == 1 and $y->[0] == 0
432 7339 41072 if (@$x == 1 and $x->[0] == 0)
444 9999 68963 ($x->[$j] += $i + $car) >= $BASE ? :
9999 68963 if $car = ($x->[$j] += $i + $car) >= $BASE ? 1 : 0
448 1 344 ($x->[$j] += $car) >= $BASE ? :
1 344 if $car = ($x->[$j] += $car) >= $BASE ? 1 : 0
460 4587 18 if ($i += 1) < $BASE
463 5 0 if $x->[-1] == 0
474 831 16 if ($i -= 1) >= 0
477 3 828 if $x->[-1] == 0 and @$x > 1
490 48976 6095 unless ($s)
492 1563 67632 unless defined $sy->[$j] or $car
493 3527 64105 if $car = ($i -= ($sy->[$j] || 0) + $car) < 0
503 43 6130 if $car = ($sy->[$j] = $i - ($sy->[$j] || 0) - $car) < 0
519 42431 11876 if (@$yv == 1)
522 32102 10329 if (@$xv == 1)
523 1417 30685 if (($xv->[0] *= $yv->[0]) >= $BASE)
530 15 10314 if ($yv->[0] == 0)
543 1968 8346 if $car != 0
548 271 11605 if @$xv == 1 and $xv->[0] == 0
551 2913 8692 if $xv == $yv
559 1697 88142 if $xi == 0
564 80888 7254 if $car
577 0 0 if (@$yv == 1)
580 0 0 if (@$xv == 1)
581 0 0 if (($xv->[0] *= $yv->[0]) >= $BASE)
589 0 0 if ($yv->[0] == 0)
604 0 0 if $car != 0
609 0 0 if @$xv == 1 and $xv->[0] == 0
612 0 0 if $xv == $yv
620 0 0 if $xi == 0
627 0 0 if $car
647 2917 12429 if (@$x == 1 and @$yorg == 1)
649 2612 305 if (wantarray) { }
661 3439 8990 if (@$yorg == 1)
663 343 3096 if wantarray
675 1302 2137 if @$x > 1 and $x->[-1] == 0
676 343 3096 if wantarray
683 248 8742 if (@$yorg > @$x)
685 241 7 if wantarray
687 241 7 if wantarray
693 784 7958 if (@$yorg == @$x)
696 763 150 if $cmp = $x->[$j] - $yorg->[$j]
699 21 763 if ($cmp == 0)
701 13 8 if wantarray
705 445 318 if ($cmp < 0)
706 21 424 if (wantarray)
722 8087 189 if ($dd != 1) { }
743 606 7670 unless $v2
746 7118 54589 unless $u2
751 16 61691 $u0 == $v1 ? :
753 57039 4668 if ($q)
759 263689 222045 if $bar = ($x->[$xi] -= $prd + $bar) < 0
761 17 57022 if ($x->[-1] < $car + $bar)
765 73 30 if $car = ($x->[$xi] += $y->[$yi] + $car) >= $BASE
774 1254 7022 if (wantarray)
776 1246 8 if ($dd != 1) { }
807 0 0 if (@$x == 1 and @$yorg == 1)
812 0 0 if wantarray
817 0 0 if (@$yorg == 1)
819 0 0 if wantarray
831 0 0 if @$x > 1 and $x->[-1] == 0
832 0 0 if wantarray
839 0 0 if (@$yorg > @$x)
841 0 0 if wantarray
843 0 0 if wantarray
849 0 0 if (@$yorg == @$x)
852 0 0 if $cmp = $x->[$j] - $yorg->[$j]
855 0 0 if ($cmp == 0)
857 0 0 if wantarray
861 0 0 if ($cmp < 0)
862 0 0 if (wantarray)
879 0 0 if ($dd != 1) { }
904 0 0 unless $v2
907 0 0 unless $u2
912 0 0 $u0 == $v1 ? :
914 0 0 if ($q)
922 0 0 if $bar = ($x->[$xi] -= $prd + $bar) < 0
924 0 0 if ($x->[-1] < $car + $bar)
928 0 0 if $car = ($x->[$xi] += $y->[$yi] + $car) >= $BASE
937 0 0 if (wantarray)
939 0 0 if ($dd != 1) { }
972 92147 18528 if @$cx == 1 and @$cy == 1
982 2935 15593 if $lxy < 0
983 4060 11533 if $lxy > 0
989 8245 29586 if $a = $cx->[$j] - $cy->[$j]
1011 33 64 if $n < 0
1016 2 95 if $n < 0 or $n >= $len
1030 2452 76485 if @$x == 1 and $x->[0] == 0
1034 76485 145540 if ($elem != 0)
1049 28417 355965 @{$_[1];} == 1 && $_[1][0] == 0 ? :
1054 45 41 $_[1][0] % 2 ? :
1059 327 379 $_[1][0] % 2 ? :
1064 1080 5133 @{$_[1];} == 1 && $_[1][0] == 1 ? :
1069 79 75 @{$_[1];} == 1 && $_[1][0] == 2 ? :
1074 0 2 if ($BASE_LEN == 1) { }
1075 0 0 @{$_[1];} == 2 && $_[1][0] == 0 && $_[1][1] == 1 ? :
1077 1 1 @{$_[1];} == 1 && $_[1][0] == 10 ? :
1086 1 64609 if @$x == 0
1087 51546 13064 if @$x == 1
1100 12577 9502 if $x->[$i] != 0
1104 6452 6612 if $i < @$x
1116 1 5497 if $msg
1120 0 5497 unless $@ eq ""
1122 0 5497 unless $n > 0
1132 0 6292 unless defined $e
1135 0 6292 unless ref $e eq ""
1142 0 6292 unless $e =~ /^\d+\z/
1145 0 6292 if $e >= $BASE
1148 0 1437 if $#$x > 0 and $i == $#$x and $e == 0
1162 805 2180 if (@$yo > 1)
1171 1654 526 if (@$x == 1)
1178 15 511 if ($b == 0) { }
155 356 elsif ($b == 1) { }
1191 0 155 if $r == $y
1206 0 356 if $r == $y
1218 0 29993 if $c->_is_zero($x) or $c->_is_zero($n)
1222 29993 0 unless ref $b
1224 49 29944 if ($c->_acmp($b, $c->_ten))
1233 165 29779 if ($src >= $xlen or $src == $xlen and not defined $x->[1])
1241 1701 28078 if ($rem == 0) { }
1253 0 180903 if length $vd > $BASE_LEN
1257 28078 0 if $dst > 0
1258 14549 13529 if $x->[-1] == 0 and @$x > 1
1266 3932 19451 if $c->_is_zero($x) or $c->_is_zero($n)
1270 19424 27 unless ref $b
1276 19423 28 if ($bstr =~ /^1(0+)\z/) { }
1294 17766 1657 if ($r)
1303 116836 17766 $i > 0 ? :
1305 0 134602 if length $vd > $BASE_LEN
1310 8876 8890 if $x->[-1] == 0
1315 15563 3860 if ($q)
1331 64 950 if (@$cy == 1 and $cy->[0] == 0)
1337 144 806 if (@$cx == 1 and $cx->[0] == 1 or @$cy == 1 and $cy->[0] == 1)
1343 1 805 if (@$cx == 1 and $cx->[0] == 0)
1355 484 1385 if substr($y_bin, $len, 1) eq 1
1375 28 28 if ($c->_acmp($twok, $n) > 0)
1386 21 35 if ($c->_is_zero($k)) { }
1432 140 0 if (@$cx == 1)
1446 69 71 if ($cx->[0] <= $#factorials)
1460 0 71 if ($BASE_LEN <= 2)
1468 55 16 if (@$cx == 1 and ($cx->[0] >= 12 and $cx->[0] < 7000))
1488 35 20 if (($k & 1) == 0)
1503 0 55 if ($cx->[0] == 0)
1522 282 0 if ($m < $BASE) { }
1527 10 272 if ($cx->[0] == 0)
1541 16 0 if @$cx == 1
1551 16 0 if (@$cx == 1 and $step == $cx->[0])
1559 0 0 if (@$cx == 1) { }
1574 0 0 if (ref $n eq 'ARRAY') { }
1580 0 0 if ($cx->[0] == 0)
1590 0 0 if ($cx->[0] == 0)
1606 0 0 if ($cx->[0] == 0)
1620 0 0 if ($cx->[0] == 0)
1632 0 0 if ($cx->[0] == 0)
1649 0 85 if @$x == 1 and $x->[0] == 0
1652 0 85 if @$base == 1 and $base->[0] < 2
1655 0 85 if (@$x == 1 and $x->[0] == 1)
1663 0 85 if ($cmp == 0)
1669 4 81 if ($cmp < 0)
1695 17 64 if $acmp == 0
1713 45 19 if $acmp == 0
1727 292 640 if (@$x == 1)
1736 225 415 if (@$x % 2) { }
1759 1352 647 if ($cmp > 0) { }
538 109 elsif ($cmp < 0) { }
1763 418 934 if $c->_is_zero($delta)
1777 113 425 if $c->_is_zero($delta)
1788 418 222 if $cmp > 0
1800 68 41 if (@$x == 1)
1801 0 68 if $x->[0] == 0 or $x->[0] == 1
1803 68 0 if (@$n == 1)
1808 2 66 if $yp1 ** $n->[0] == $x->[0]
1816 0 41 if (@$x > 1 || $x->[0] > 0 and $c->_acmp($x, $n) <= 0)
1828 24 17 if ($b =~ /0b1(0+)$/)
1887 0 17 if ($DEBUG)
1898 17 0 $ye < 15 ? :
1905 0 17 if ($DEBUG)
1918 5 12 if ($acmp == 0)
1932 7 5 if ($acmp < 0) { }
5 0 elsif ($acmp > 0) { }
1937 0 7 if ($DEBUG)
1944 0 7 if ($acmp == 0)
1955 0 5 if ($c->_acmp($upper, $delta) <= 0)
1961 0 5 if ($DEBUG)
1968 0 5 if ($acmp == 0)
1982 12 0 if ($c->_acmp($delta, $one) <= 0)
1987 0 0 if ($DEBUG)
1998 0 0 if ($acmp < 0) { }
0 0 elsif ($acmp > 0) { }
2022 64 66 if $c->_acmp($x, $y) == 0
2048 64 130 if $c->_acmp($x, $y) == 0
2073 41 89 unless $c->_is_zero($x1)
2074 24 106 unless $c->_is_zero($y1)
2083 64 125 if $c->_acmp($x, $y) == 0
2107 41 84 unless $c->_is_zero($x1)
2108 24 101 unless $c->_is_zero($y1)
2118 43 218 if @$x == 1 and $x->[0] == 0
2139 49 1095 if @$x == 1 and $x->[0] == 0
2160 10 46 if @$x == 1 and $x->[0] == 0
2195 19 1 if $val != 0
2196 7 13 if $len >= 0
2215 1470 757 if $len == 0
2222 0 2227 if (length $val > $BASE_LEN)
2225 2066 161 if $val != 0
2226 757 1470 if $len >= 0
2241 228 20 if $l % 8 != 0
2256 0 124 if ($c->_is_zero($y))
2261 0 124 if ($c->_is_one($y))
2276 124 145 if $c->_is_zero($b)
2288 21 103 unless $c->_is_one($a)
2290 48 55 $sign == 1 ? :
2298 150 282 if ($c->_is_one($mod))
2305 36 246 if ($c->_is_zero($num))
2306 9 27 if ($c->_is_zero($exp)) { }
2323 507 444 if (substr($expbin, $len, 1) eq 1)
2342 8 80 if (@$x == 1 and $x->[0] == 0)
2343 4 4 if (@$y == 1 and $y->[0] == 0) { }