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 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 25621 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
1032 0 15 unless ref $x
1033 0 15 unless ref $y
1035 0 15 unless $x->isa($class)
1036 1 14 unless $y->isa($class)
1046 0 22 unless ref $x
1047 0 22 unless ref $y
1049 0 22 unless $x->isa($class)
1050 6 16 unless $y->isa($class)
1060 0 21 unless ref $x
1061 0 21 unless ref $y
1063 0 21 unless $x->isa($class)
1064 6 15 unless $y->isa($class)
1077 14 46 if $up
1080 0 46 if abs $$x > $MAX_ADD
1087 2 206 if $up
1089 0 206 if abs $$x > $MAX_ADD
1096 3 120 if $up
1098 0 120 if $$x eq "-0"
1106 6 57 if $up
1107 3 54 if $$y == 0
1116 12 96 if $up
1118 6 90 if $$y == 0
1121 0 90 if defined $Math::BigInt::upgrade
1128 17 73 if $$rem != 0 and ($$x <=> 0) != ($$y <=> 0)
1132 42 48 if (wantarray)
1144 12 90 if $up
1146 6 84 if $$y == 0
1149 0 84 if defined $Math::BigInt::upgrade
1154 42 42 if (wantarray)
1156 8 34 if $$rem != 0 and ($$x <=> 0) != ($$y <=> 0)
1163 42 42 if wantarray
1172 2 0 ref $_[0] ? :
1174 2 0 if $x->isa($class)
1180 2 0 ref $_[0] ? :
1182 2 0 if $x->isa($class)
1188 165 0 ref $_[0] ? :
1190 165 0 if $x->isa($class)
1196 11 0 ref $_[0] ? :
1198 11 0 if $x->isa($class)
1204 3 0 ref $_[0] ? :
1206 3 0 if $x->isa($class)
1212 3 0 ref $_[0] ? :
1214 3 0 if $x->isa($class)
1220 9 0 ref $_[0] ? :
1223 2 7 if ($s || '+') eq "-"
1224 9 0 if $x->isa($class)
1230 10 0 ref $_[0] ? :
1232 0 10 unless $x->isa($class)
1233 6 4 $$x & 1 ? :
1238 10 0 ref $_[0] ? :
1240 0 10 unless $x->isa($class)
1241 6 4 $$x & 1 ? :
1248 2 0 ref $_[0] ? :
1250 1 1 $$x >= 0 ? :
1254 6 0 ref $_[0] ? :
1256 0 6 if defined $upgrade and not $x->isa($class)
1259 6 0 if ($$x =~ / ^ ( [+-]? (?: 0 | [1-9] (?: \d* [1-9] )? ) ) ( 0* ) $ /x)
1278 6 0 ref $_[0] ? :
1280 0 6 if defined $upgrade and not $x->isa($class)
1284 6 0 if ($$x =~ / (?: ^ 0 | [1-9] ) ( 0* ) $/x)
1294 5 0 ref $_[0] ? :
1296 0 5 if defined $upgrade and not $x->isa($class)
1299 5 0 if ($$x =~ / ^ ( [+-]? (?: 0 | [1-9] (?: \d* [1-9] )? ) ) /x)
1314 0 0 ref $_[0] ? :
1316 0 0 if defined $upgrade and not $x->isa($class)
1319 0 0 if ($$x =~ / ^ ( [+-]? (?: 0 | [1-9] (?: \d* [1-9] )? ) ) ( 0* ) $ /x)
1330 0 0 unless wantarray
1339 0 0 ref $_[0] ? :
1341 0 0 if defined $upgrade and not $x->isa($class)
1345 0 0 if ($$x =~ / ^ ( [+-]? \d ) ( 0* ) $ /x) { }
0 0 elsif ($$x =~ / ^ ( [+-]? [1-9] ) ( \d+ ) $ /x) { }
1367 0 0 unless wantarray
1372 0 0 ref $_[0] ? :
1374 0 0 if defined $upgrade and not $x->isa($class)
1381 0 0 if ($mant->bcmp(0))
1391 0 0 if ($ndigmant > $c)
1392 0 0 if defined $upgrade
1394 0 0 unless wantarray
1401 0 0 unless wantarray
1406 0 0 ref $_[0] ? :
1408 0 0 if defined $upgrade and not $x->isa($class)
1413 0 0 unless wantarray
1418 0 0 ref $_[0] ? :
1420 0 0 if defined $upgrade and not $x->isa($class)
1425 0 0 unless wantarray
1430 21 1 ref $_[0] ? :
1432 0 22 unless $x->isa($class)
1434 0 22 unless defined $n
1437 7 15 if $n < 0
1440 0 22 if $n > $len
1446 6 0 ref $_[0] ? :
1448 0 6 unless $x->isa($class)
1450 1 5 if $$x < 0
1458 25 0 ref $_[0] ? :
1465 115 0 ref $_[0] ? :
1467 108 7 if $$x != 0
1472 5 0 ref $_[0] ? :
1482 5 0 ref $_[0] ? :
1487 5 0 ref $_[0] ? :
1492 17 0 ref $_[0] ? :
1495 17 0 if $x->isa($class)
1500 15 0 ref $_[0] ? :
1503 15 0 if $x->isa($class)
1510 97 0 if $x->isa($class)
1511 75 22 if $y->isa($class)
1522 0 38 if (not ref $_[0] and $_[0] =~ /^[A-Za-z]|::/) { }
1524 0 0 defined $_[2] ? :
1528 33 5 defined $_[1] ? :
1532 38 0 if $x->isa($class)
1533 26 12 if defined $base and $base->isa($class)
1541 2 0 if $x->isa($class)
1549 20 0 if $x->isa($class)
1557 4880 0 if $x->isa($class)
1558 4815 65 if $y->isa($class)
1566 31 0 if $x->isa($class)
1567 26 5 if defined $base and $base->isa($class)
1575 27 0 if $x->isa($class)
1576 25 2 if defined $y and $y->isa($class)
1577 25 2 if defined $z and $z->isa($class)
1585 160 0 if $x->isa($class)
1586 157 3 if defined $y and $y->isa($class)
1594 29 0 if $x->isa($class)
1595 26 3 if defined $y and $y->isa($class)
1601 17 0 ref $_[0] ? :
1605 0 17 unless $x->isa($class)
1607 2 15 if $$x < 0
1611 7 8 if (int $s != $s)
1649 0 0 if ($_[$i] eq ':constant') { }
0 0 elsif ($_[$i] eq 'upgrade') { }
0 0 elsif ($_[$i] eq 'lib') { }
1658 0 0 if @a - $j < 2
1664 0 0 if @a - $j < 2