Branch Coverage

blib/lib/Math/BigInt/Lite.pm
Criterion Covered Total %
branch 279 556 50.1


line true false branch
53 6 48 unless $num =~ /^9{$e0}89{$e1}$/
63 0 6 if $^O =~ /^uts/
64 0 6 if $^O =~ /^unicos/
66 6 0 if $e > 8
110 77 0 if (defined $_[0])
112 0 77 unless $m =~ /^(even|odd|\+inf|\-inf|zero|trunc|common)$/
132 0 0 if (@_ > 0)
134 0 0 if defined $a and $a == 0
135 0 0 if (ref $x) { }
137 0 0 if defined $a
150 0 0 if (ref $x)
168 0 0 if (@_ > 0)
170 0 0 if (ref $x) { }
172 0 0 if defined $p
184 0 0 if (ref $x)
196 8 1 unless ref $y
197 9 0 if ($y->isa($class)) { }
200 0 9 if abs $$x >= $MAX_ADD
211 1 1 unless ref $y
212 2 0 if ($y->isa($class)) { }
214 0 2 if $$x eq "-0"
235 0 0 defined $cmp && $_[2] ? :
243 0 0 if ${$_[0];} >= $MAX_ADD
249 0 0 if ${$_[0];} <= -$MAX_ADD
255 7 12 $_[0] < 0 ? :
268 0 2 if @_ == 1 and ref $_[0] eq "HASH"
272 2 0 if (@_ == 1)
276 1 1 if $param eq "lib" or $param eq "lib_version"
284 0 0 if @_
301 0 26 unless (@_ and ref $_[0] || $_[0] =~ /^[a-z]\w*(?:::[a-z]\w*)*$/i)
313 0 26 unless $class->isa(__PACKAGE__)
323 10 37 unless ($arg->isa($class))
328 10 16 if $do_upgrade
337 1 15 if $$b == 0
355 0 8 unless (@_ and ref $_[0] || $_[0] =~ /^[a-z]\w*(?:::[a-z]\w*)*$/i)
367 12 4 unless defined builtin::blessed($arg) and $arg->isa($upgrade)
377 24126 1262 $_[1] =~ /^Math::BigInt::Lite/ ? :
383 0 14379 unless defined $wanted
386 14379 0 unless (ref $wanted)
387 12716 1663 if (CORE::length $wanted <= $MAX_NEW_LEN and $wanted =~ /^[+-]?[0-9]{1,$MAX_NEW_LEN}(\.0*)?\z/)
393 37 1626 if ($wanted =~ /^([+-])?([0-9]+)[eE][+]?([0-9]+)$/)
394 28 9 if (CORE::length($2) + $3 < $MAX_NEW_LEN)
409 2960 0 ref $_[0] ? :
411 0 2960 if defined $upgrade and not $x->isa($class)
421 627 0 ref $_[0] ? :
423 0 627 if defined $upgrade and not $x->isa($class)
426 627 0 if ($$x =~ / ^ ( [+-]? (?: 0 | [1-9] (?: \d* [1-9] )? ) ) ( 0* ) $ /x)
447 0 0 ref $_[0] ? :
449 0 0 if defined $upgrade and not $x->isa($class)
454 0 0 if ($$x =~ / ^ ( [+-]? \d ) ( 0* ) $ /x)
466 0 0 if ($$x =~ / ^ ( [+-]? [1-9] ) ( ( \d* [1-9] ) 0* ) $ /x)
486 0 0 ref $_[0] ? :
488 0 0 if defined $upgrade and not $x->isa($class)
491 0 0 if ($$x =~ / ^ ( [+-]? ) ( 0 | [1-9] (?: \d* [1-9] )? ) ( 0* ) $ /x)
509 0 0 if ($dotpos < $mantlen) { }
0 0 elsif ($dotpos > $mantlen) { }
515 0 0 $sign eq '-' ? :
525 0 0 ref $_[0] ? :
527 0 0 if defined $upgrade and not $x->isa($class)
537 2 0 ref $_[0] ? :
539 0 2 if defined $upgrade and not $x->isa($class)
549 0 211 ref $_[0] ? :
564 13 385 if not ref $_[0] and $_[0] =~ /^Math::BigInt::Lite/
570 0 398 if defined $r[0] or defined $r[1] or defined $accuracy or defined $precision
572 13 385 unless ref $x
573 36 362 unless ref $y
574 45 353 unless $x->isa($class) and $y->isa($class)
576 45 353 if ($up == 1)
577 45 0 if $x->isa($class)
578 0 45 if $y->isa($class)
595 2 35 if not ref $_[0] and $_[0] =~ /^Math::BigInt::Lite/
601 0 37 if defined $r[0] or defined $r[1] or defined $accuracy or defined $precision
603 2 35 unless ref $x
604 3 34 unless ref $y
605 3 34 unless $x->isa($class) and $y->isa($class)
606 0 34 if $up == 0 and abs $$x >= $MAX_MUL || abs $$y >= $MAX_MUL
607 3 34 if ($up == 1)
608 3 0 if $x->isa($class)
609 0 3 if $y->isa($class)
625 0 6 if defined $r[0] or defined $r[1] or defined $accuracy or defined $precision
627 0 6 unless ref $x
628 0 6 unless $x->isa($class)
629 0 6 if ($up == 1)
630 0 0 if $x->isa($class)
639 9 0 ref $_[0] ? :
644 9 0 if $x->isa($class)
649 1 0 ref $_[0] ? :
654 1 0 if $x->isa($class)
660 2 0 ref $_[0] ? :
662 2 0 if $x->isa($class)
689 8 4 if (defined $_[0] and $_[0] =~ /^\s*([+-])\s*$/) { }
696 4 8 $sign eq '-' ? :
697 6 6 unless ref $x
706 2 1 unless ref $x
713 90 5 ref $_[0] && ref $_[0] eq ref $_[1] ? :
717 5 90 if defined $upgrade and not $x->isa($class) && $y->isa($class)
725 7 5 ref $_[0] && ref $_[0] eq ref $_[1] ? :
729 5 7 if defined $upgrade and not $x->isa($class) && $y->isa($class)
740 289 0 if (ref $_[0]) { }
753 624 0 ref $_[0] ? :
755 0 624 if $x->isa("Math::BigInt")
775 1 0 ref $_[0] ? :
777 0 1 unless ref $x
779 1 0 if $x->isa($class)
784 81 0 ref $_[0] ? :
786 81 0 if $x->isa($class)
791 5 0 ref $_[0] ? :
793 5 0 if $x->isa($class)
798 5 0 ref $_[0] ? :
800 5 0 if $x->isa($class)
805 5 0 ref $_[0] ? :
807 5 0 if $x->isa($class)
820 0 0 unless $selfref
822 0 0 if ($str =~ s/ ^ \s* ( [+-]? ) ( 0? [Xx] )? ( [0-9a-fA-F]* ( _ [0-9a-fA-F]+ )* ) \s* $ //x)
841 0 0 unless CORE::length $chrs
843 0 0 if CORE::length $chrs > $MAX_HEX_LEN
847 0 0 if $sign eq "-"
867 0 0 unless $selfref
869 0 0 if ($str =~ s/ ^ \s* ( [+-]? ) ( 0? [Oo] )? ( [0-7]* ( _ [0-7]+ )* ) \s* $ //x)
888 0 0 unless CORE::length $chrs
890 0 0 if CORE::length $chrs > $MAX_OCT_LEN
894 0 0 if $sign eq "-"
914 0 0 unless $selfref
916 0 0 if ($str =~ s/ ^ \s* ( [+-]? ) ( 0? [Bb] )? ( [01]* ( _ [01]+ )* ) \s* $ //x)
935 0 0 unless CORE::length $chrs
937 0 0 if CORE::length $chrs > $MAX_BIN_LEN
941 0 0 if $sign eq "-"
959 0 3 if $up
961 0 3 if abs $$x > $MAX_ADD
969 0 3 if $up
971 0 3 if abs $$x > $MAX_ADD
982 0 26 unless ref $x
983 0 26 unless ref $y
984 0 26 if ref $b and $b->isa($class)
986 0 26 unless ($x->isa($class))
987 0 0 if $y->isa($class)
990 0 26 unless $y->isa($class)
993 3 23 unless defined $b
995 8 18 if $b != 2 or $$y < 0
1006 0 12 unless ref $x
1007 0 12 unless ref $y
1009 0 12 unless $x->isa($class)
1010 0 12 unless $y->isa($class)
1014 0 12 if $$y > 31
1016 3 9 unless defined $b
1018 6 6 if $b != 2 or $$y < 0
1032 5 0 ref $_[0] ? :
1040 2 0 ref $_[0] ? :
1047 14 1 ref $_[0] && ref $_[0] eq ref $_[1] ? :
1050 1 14 unless $x->isa($class) and $y->isa($class)
1060 16 6 ref $_[0] && ref $_[0] eq ref $_[1] ? :
1063 6 16 unless $x->isa($class) and $y->isa($class)
1073 15 6 ref $_[0] && ref $_[0] eq ref $_[1] ? :
1076 6 15 unless $x->isa($class) and $y->isa($class)
1091 14 46 if $up
1094 0 46 if abs $$x > $MAX_ADD
1101 1 64 if $up
1103 0 64 if abs $$x > $MAX_ADD
1110 3 34 if $up
1112 0 34 if $$x eq "-0"
1120 6 57 if $up
1121 3 54 if $$y == 0
1130 12 96 if $up
1132 6 90 if $$y == 0
1135 0 90 if defined $Math::BigInt::upgrade
1142 17 73 if $$rem != 0 and ($$x <=> 0) != ($$y <=> 0)
1146 42 48 if (wantarray)
1158 12 90 if $up
1160 6 84 if $$y == 0
1163 0 84 if defined $Math::BigInt::upgrade
1168 42 42 if (wantarray)
1170 8 34 if $$rem != 0 and ($$x <=> 0) != ($$y <=> 0)
1177 42 42 if wantarray
1186 3 0 ref $_[0] ? :
1188 3 0 if $x->isa($class)
1194 7 0 ref $_[0] ? :
1196 7 0 if $x->isa($class)
1202 4 0 ref $_[0] ? :
1204 4 0 if $x->isa($class)
1210 11 0 ref $_[0] ? :
1212 11 0 if $x->isa($class)
1218 3 0 ref $_[0] ? :
1220 3 0 if $x->isa($class)
1226 3 0 ref $_[0] ? :
1228 3 0 if $x->isa($class)
1234 9 0 ref $_[0] ? :
1237 2 7 if ($s || '+') eq "-"
1238 9 0 if $x->isa($class)
1244 10 0 ref $_[0] ? :
1246 0 10 unless $x->isa($class)
1247 6 4 $$x & !0 ? :
1252 10 0 ref $_[0] ? :
1254 0 10 unless $x->isa($class)
1255 6 4 $$x & !0 ? :
1262 0 0 ref $_[0] ? :
1264 0 0 $$x >= 0 ? :
1268 6 0 ref $_[0] ? :
1270 0 6 if defined $upgrade and not $x->isa($class)
1273 6 0 if ($$x =~ / ^ ( [+-]? (?: 0 | [1-9] (?: \d* [1-9] )? ) ) ( 0* ) $ /x)
1292 6 0 ref $_[0] ? :
1294 0 6 if defined $upgrade and not $x->isa($class)
1298 6 0 if ($$x =~ / (?: ^ 0 | [1-9] ) ( 0* ) $/x)
1308 5 0 ref $_[0] ? :
1310 0 5 if defined $upgrade and not $x->isa($class)
1313 5 0 if ($$x =~ / ^ ( [+-]? (?: 0 | [1-9] (?: \d* [1-9] )? ) ) /x)
1328 0 0 ref $_[0] ? :
1330 0 0 if defined $upgrade and not $x->isa($class)
1333 0 0 if ($$x =~ / ^ ( [+-]? (?: 0 | [1-9] (?: \d* [1-9] )? ) ) ( 0* ) $ /x)
1344 0 0 unless wantarray
1353 0 0 ref $_[0] ? :
1355 0 0 if defined $upgrade and not $x->isa($class)
1359 0 0 if ($$x =~ / ^ ( [+-]? \d ) ( 0* ) $ /x) { }
0 0 elsif ($$x =~ / ^ ( [+-]? [1-9] ) ( \d+ ) $ /x) { }
1381 0 0 unless wantarray
1386 0 0 ref $_[0] ? :
1388 0 0 if defined $upgrade and not $x->isa($class)
1395 0 0 if ($mant->bcmp(0))
1405 0 0 if ($ndigmant > $c)
1406 0 0 if defined $upgrade
1408 0 0 unless wantarray
1415 0 0 unless wantarray
1420 0 0 ref $_[0] ? :
1422 0 0 if defined $upgrade and not $x->isa($class)
1427 0 0 unless wantarray
1432 0 0 ref $_[0] ? :
1434 0 0 if defined $upgrade and not $x->isa($class)
1439 0 0 unless wantarray
1444 21 1 ref $_[0] ? :
1446 0 22 unless $x->isa($class)
1448 0 22 unless defined $n
1451 7 15 if $n < 0
1454 0 22 if $n > $len
1460 6 0 ref $_[0] ? :
1462 0 6 unless $x->isa($class)
1464 1 5 if $$x < 0
1472 25 0 ref $_[0] ? :
1479 29 0 ref $_[0] ? :
1481 22 7 if $$x != 0
1486 5 0 ref $_[0] ? :
1496 5 0 ref $_[0] ? :
1501 5 0 ref $_[0] ? :
1506 5 0 ref $_[0] ? :
1511 17 0 ref $_[0] ? :
1514 17 0 if $x->isa($class)
1519 15 0 ref $_[0] ? :
1522 15 0 if $x->isa($class)
1527 16 0 ref $_[0] ? :
1530 16 0 if $x->isa($class)
1537 75 0 if $x->isa($class)
1544 97 0 if $x->isa($class)
1545 75 22 if $y->isa($class)
1556 0 38 if (not ref $_[0] and $_[0] =~ /^[A-Za-z]|::/) { }
1558 0 0 defined $_[2] ? :
1562 33 5 defined $_[1] ? :
1566 38 0 if $x->isa($class)
1567 26 12 if defined $base and $base->isa($class)
1575 2 0 if $x->isa($class)
1583 20 0 if $x->isa($class)
1591 4880 0 if $x->isa($class)
1592 4815 65 if $y->isa($class)
1600 31 0 if $x->isa($class)
1601 26 5 if defined $base and $base->isa($class)
1609 27 0 if $x->isa($class)
1610 25 2 if defined $y and $y->isa($class)
1611 25 2 if defined $z and $z->isa($class)
1619 160 0 if $x->isa($class)
1620 157 3 if defined $y and $y->isa($class)
1628 29 0 if $x->isa($class)
1629 26 3 if defined $y and $y->isa($class)
1635 17 0 ref $_[0] ? :
1639 0 17 unless $x->isa($class)
1641 2 15 if $$x < 0
1645 7 8 if (int $s != $s)
1683 0 0 if ($_[$i] eq ':constant') { }
0 0 elsif ($_[$i] eq 'upgrade') { }
0 0 elsif ($_[$i] eq 'lib') { }
1692 0 0 if @a - $j < 2
1698 0 0 if @a - $j < 2