Branch Coverage

blib/lib/Math/BigInt/Lite.pm
Criterion Covered Total %
branch 277 548 50.5


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 25611 1131 $_[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 2978 0 ref $_[0] ? :
411 0 2978 if defined $upgrade and not $x->isa($class)
421 558 0 ref $_[0] ? :
423 0 558 if defined $upgrade and not $x->isa($class)
426 558 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 555 0 ref $_[0] ? :
755 0 555 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 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 2 206 if $up
1103 0 206 if abs $$x > $MAX_ADD
1110 3 120 if $up
1112 0 120 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 2 0 ref $_[0] ? :
1188 2 0 if $x->isa($class)
1194 2 0 ref $_[0] ? :
1196 2 0 if $x->isa($class)
1202 165 0 ref $_[0] ? :
1204 165 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 & 1 ? :
1252 10 0 ref $_[0] ? :
1254 0 10 unless $x->isa($class)
1255 6 4 $$x & 1 ? :
1262 2 0 ref $_[0] ? :
1264 1 1 $$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 115 0 ref $_[0] ? :
1481 108 7 if $$x != 0
1486 5 0 ref $_[0] ? :
1496 5 0 ref $_[0] ? :
1501 5 0 ref $_[0] ? :
1506 17 0 ref $_[0] ? :
1509 17 0 if $x->isa($class)
1514 15 0 ref $_[0] ? :
1517 15 0 if $x->isa($class)
1524 97 0 if $x->isa($class)
1525 75 22 if $y->isa($class)
1536 0 38 if (not ref $_[0] and $_[0] =~ /^[A-Za-z]|::/) { }
1538 0 0 defined $_[2] ? :
1542 33 5 defined $_[1] ? :
1546 38 0 if $x->isa($class)
1547 26 12 if defined $base and $base->isa($class)
1555 2 0 if $x->isa($class)
1563 20 0 if $x->isa($class)
1571 4880 0 if $x->isa($class)
1572 4815 65 if $y->isa($class)
1580 31 0 if $x->isa($class)
1581 26 5 if defined $base and $base->isa($class)
1589 27 0 if $x->isa($class)
1590 25 2 if defined $y and $y->isa($class)
1591 25 2 if defined $z and $z->isa($class)
1599 160 0 if $x->isa($class)
1600 157 3 if defined $y and $y->isa($class)
1608 29 0 if $x->isa($class)
1609 26 3 if defined $y and $y->isa($class)
1615 17 0 ref $_[0] ? :
1619 0 17 unless $x->isa($class)
1621 2 15 if $$x < 0
1625 7 8 if (int $s != $s)
1663 0 0 if ($_[$i] eq ':constant') { }
0 0 elsif ($_[$i] eq 'upgrade') { }
0 0 elsif ($_[$i] eq 'lib') { }
1672 0 0 if @a - $j < 2
1678 0 0 if @a - $j < 2