Branch Coverage

blib/lib/Math/BigInt/Lite.pm
Criterion Covered Total %
branch 276 544 50.7


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 24 85 $_[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 7 19 unless $class->isa("Math::BigInt::Lite")
323 3 37 unless ($arg->isa($class))
328 3 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 11 5 unless defined &blessed($arg) and $arg->isa($upgrade)
377 25634 1101 $_[1] =~ /^Math::BigInt::Lite/ ? :
383 0 14638 unless defined $wanted
386 14638 0 unless (ref $wanted)
387 12975 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 2984 0 ref $_[0] ? :
411 0 2984 if defined $upgrade and not $x->isa($class)
421 543 0 ref $_[0] ? :
423 0 543 if defined $upgrade and not $x->isa($class)
426 543 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 0 0 ref $_[0] ? :
539 0 0 if defined $upgrade and not $x->isa($class)
549 0 211 ref $_[0] ? :
564 13 528 if not ref $_[0] and $_[0] =~ /^Math::BigInt::Lite/
570 0 541 if defined $r[0] or defined $r[1] or defined $accuracy or defined $precision
572 13 528 unless ref $x
573 36 505 unless ref $y
574 46 495 unless $x->isa($class) and $y->isa($class)
576 46 495 if ($up == 1)
577 46 0 if $x->isa($class)
578 0 46 if $y->isa($class)
595 2 121 if not ref $_[0] and $_[0] =~ /^Math::BigInt::Lite/
601 0 123 if defined $r[0] or defined $r[1] or defined $accuracy or defined $precision
603 2 121 unless ref $x
604 3 120 unless ref $y
605 3 120 unless $x->isa($class) and $y->isa($class)
606 0 120 if $up == 0 and abs $$x >= $MAX_MUL || abs $$y >= $MAX_MUL
607 3 120 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 64 0 ref $_[0] ? :
662 64 0 if $x->isa($class)
689 8 109 if (defined $_[0] and $_[0] =~ /^\s*([+-])\s*$/) { }
696 4 113 $sign eq '-' ? :
697 87 30 unless ref $x
706 2 1 unless ref $x
713 561 6 ref $_[0] && ref $_[0] eq ref $_[1] ? :
717 6 561 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 432 0 if (ref $_[0]) { }
753 540 0 ref $_[0] ? :
755 0 540 if $x->isa("Math::BigInt")
775 3 0 ref $_[0] ? :
777 0 3 unless ref $x
779 3 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 29 unless ref $x
983 0 29 unless ref $y
984 0 29 if ref $b and $b->isa($class)
986 0 29 unless ($x->isa($class))
987 0 0 if $y->isa($class)
990 0 29 unless $y->isa($class)
993 6 23 unless defined $b
995 9 20 if $b != 2 or $$y < 0
1006 0 17 unless ref $x
1007 0 17 unless ref $y
1009 0 17 unless $x->isa($class)
1010 0 17 unless $y->isa($class)
1014 2 15 if $$y > 31
1016 6 9 unless defined $b
1018 7 8 if $b != 2 or $$y < 0
1030 14 1 ref $_[0] && ref $_[0] eq ref $_[1] ? :
1033 1 14 unless $x->isa($class) and $y->isa($class)
1043 16 6 ref $_[0] && ref $_[0] eq ref $_[1] ? :
1046 6 16 unless $x->isa($class) and $y->isa($class)
1056 15 6 ref $_[0] && ref $_[0] eq ref $_[1] ? :
1059 6 15 unless $x->isa($class) and $y->isa($class)
1074 14 46 if $up
1077 0 46 if abs $$x > $MAX_ADD
1084 2 206 if $up
1086 0 206 if abs $$x > $MAX_ADD
1093 3 120 if $up
1095 0 120 if $$x eq "-0"
1103 6 57 if $up
1104 3 54 if $$y == 0
1113 12 96 if $up
1115 6 90 if $$y == 0
1118 0 90 if defined $Math::BigInt::upgrade
1125 17 73 if $$rem != 0 and ($$x <=> 0) != ($$y <=> 0)
1129 42 48 if (wantarray)
1141 12 90 if $up
1143 6 84 if $$y == 0
1146 0 84 if defined $Math::BigInt::upgrade
1151 42 42 if (wantarray)
1153 8 34 if $$rem != 0 and ($$x <=> 0) != ($$y <=> 0)
1160 42 42 if wantarray
1169 2 0 ref $_[0] ? :
1171 2 0 if $x->isa($class)
1177 2 0 ref $_[0] ? :
1179 2 0 if $x->isa($class)
1185 165 0 ref $_[0] ? :
1187 165 0 if $x->isa($class)
1193 11 0 ref $_[0] ? :
1195 11 0 if $x->isa($class)
1201 3 0 ref $_[0] ? :
1203 3 0 if $x->isa($class)
1209 3 0 ref $_[0] ? :
1211 3 0 if $x->isa($class)
1217 9 0 ref $_[0] ? :
1220 2 7 if ($s || '+') eq "-"
1221 9 0 if $x->isa($class)
1227 10 0 ref $_[0] ? :
1229 0 10 unless $x->isa($class)
1230 6 4 $$x & 1 ? :
1235 10 0 ref $_[0] ? :
1237 0 10 unless $x->isa($class)
1238 6 4 $$x & 1 ? :
1245 2 0 ref $_[0] ? :
1247 1 1 $$x >= 0 ? :
1251 6 0 ref $_[0] ? :
1253 0 6 if defined $upgrade and not $x->isa($class)
1256 6 0 if ($$x =~ / ^ ( [+-]? (?: 0 | [1-9] (?: \d* [1-9] )? ) ) ( 0* ) $ /x)
1275 6 0 ref $_[0] ? :
1277 0 6 if defined $upgrade and not $x->isa($class)
1281 6 0 if ($$x =~ / (?: ^ 0 | [1-9] ) ( 0* ) $/x)
1291 5 0 ref $_[0] ? :
1293 0 5 if defined $upgrade and not $x->isa($class)
1296 5 0 if ($$x =~ / ^ ( [+-]? (?: 0 | [1-9] (?: \d* [1-9] )? ) ) /x)
1311 0 0 ref $_[0] ? :
1313 0 0 if defined $upgrade and not $x->isa($class)
1316 0 0 if ($$x =~ / ^ ( [+-]? (?: 0 | [1-9] (?: \d* [1-9] )? ) ) ( 0* ) $ /x)
1327 0 0 unless wantarray
1336 0 0 ref $_[0] ? :
1338 0 0 if defined $upgrade and not $x->isa($class)
1342 0 0 if ($$x =~ / ^ ( [+-]? \d ) ( 0* ) $ /x) { }
0 0 elsif ($$x =~ / ^ ( [+-]? [1-9] ) ( \d+ ) $ /x) { }
1364 0 0 unless wantarray
1369 0 0 ref $_[0] ? :
1371 0 0 if defined $upgrade and not $x->isa($class)
1378 0 0 if ($mant->bcmp(0))
1388 0 0 if ($ndigmant > $c)
1389 0 0 if defined $upgrade
1391 0 0 unless wantarray
1398 0 0 unless wantarray
1403 0 0 ref $_[0] ? :
1405 0 0 if defined $upgrade and not $x->isa($class)
1410 0 0 unless wantarray
1415 0 0 ref $_[0] ? :
1417 0 0 if defined $upgrade and not $x->isa($class)
1422 0 0 unless wantarray
1427 21 1 ref $_[0] ? :
1429 0 22 unless $x->isa($class)
1431 0 22 unless defined $n
1434 7 15 if $n < 0
1437 0 22 if $n > $len
1443 6 0 ref $_[0] ? :
1445 0 6 unless $x->isa($class)
1447 1 5 if $$x < 0
1455 25 0 ref $_[0] ? :
1462 115 0 ref $_[0] ? :
1464 108 7 if $$x != 0
1469 5 0 ref $_[0] ? :
1479 5 0 ref $_[0] ? :
1484 5 0 ref $_[0] ? :
1489 17 0 ref $_[0] ? :
1492 17 0 if $x->isa($class)
1497 15 0 ref $_[0] ? :
1500 15 0 if $x->isa($class)
1507 97 0 if $x->isa($class)
1508 75 22 if $y->isa($class)
1519 0 38 if (not ref $_[0] and $_[0] =~ /^[A-Za-z]|::/) { }
1521 0 0 defined $_[2] ? :
1525 33 5 defined $_[1] ? :
1529 38 0 if $x->isa($class)
1530 26 12 if defined $base and $base->isa($class)
1538 2 0 if $x->isa($class)
1546 20 0 if $x->isa($class)
1554 4880 0 if $x->isa($class)
1555 4815 65 if $y->isa($class)
1563 31 0 if $x->isa($class)
1564 26 5 if defined $base and $base->isa($class)
1572 27 0 if $x->isa($class)
1573 25 2 if defined $y and $y->isa($class)
1574 25 2 if defined $z and $z->isa($class)
1582 160 0 if $x->isa($class)
1583 157 3 if defined $y and $y->isa($class)
1591 29 0 if $x->isa($class)
1592 26 3 if defined $y and $y->isa($class)
1598 17 0 ref $_[0] ? :
1602 0 17 unless $x->isa($class)
1604 2 15 if $$x < 0
1608 7 8 if (int $s != $s)
1646 0 0 if ($_[$i] eq ':constant') { }
0 0 elsif ($_[$i] eq 'upgrade') { }
0 0 elsif ($_[$i] eq 'lib') { }
1655 0 0 if @a - $j < 2
1661 0 0 if @a - $j < 2