Branch Coverage

blib/lib/Math/Decimal128.pm
Criterion Covered Total %
branch 130 204 63.7


line true false branch
376 4179345 2265457 if ($val > 0)
397 12 48 if (is_InfD128($_[0]) or not $_[0])
405 358 47372 if (is_NaND128($_[0]) or is_InfD128($_[0]) or is_ZeroD128($_[0]))
407 23499 23873 if ($exp >= 0)
409 23865 8 if $man =~ /^\-/
410 23858 15 if (-$exp >= $man_length)
412 23857 1 if ($_[0] < $z)
433 1 309405 unless (@_)
435 2 309403 if (@_ > 3)
443 309392 11 if (not ref $_[0] and $_[0] eq 'Math::Decimal128')
445 11 309381 unless (@_)
450 1 309391 if (@_ > 2)
452 309258 133 if (@_ == 2)
457 13 120 if ($type == 1)
461 15 105 if ($type == 2)
465 3 102 if ($type == 3)
469 74 28 if ($type == 4)
470 0 74 if have_strtod128()
474 25 3 if ($type == 34)
486 35 179861 unless defined $ret2
487 917 178979 if is_ZeroD128($_[0])
496 0 373640 if @_ != 2
500 1 373639 if $arg1 =~ /[^0-9\-\+]/
501 0 373639 if $arg2 =~ /[^0-9\-\+]/
505 198212 175427 $arg1 =~ s/^\-// ? :
509 11279 362360 if ($len_1 > 34 or $arg2 < -6176)
510 1 11278 if $len_1 > 34
541 0 11278 if ($man =~ /^\-/)
549 4286 6992 if ($length >= $maxlen)
551 4025 261 $length > $maxlen ? :
554 1697 2589 if substr($rounder, 0, 1) > 5
555 447 12 if substr($rounder, 0, 1) == 5 and substr($rounder, 1) =~ /[1-9]/ || substr($man, -1, 1) % 2 == 1
558 2144 2142 if $roundup
571 0 13 if @_ != 3
577 2 11 if _itsa($arg1) != 34
578 0 11 if $arg2 =~ /[^0-9\-]/
579 0 11 if $arg3 =~ /[^0-9\-]/
582 4 7 $arg2 =~ /^\-/ ? :
583 4 7 if ($sign)
588 0 11 if ($len_2 > 34 or $arg3 < -6176)
589 0 0 if $len_2 > 34
614 0 0 defined $adj[1] ? :
642 0 194453 if $len != 128
653 0 37 if d128_bytes($d128) =~ /534$/i
654 37 0 if d128_bytes($d128) =~ /FF2$/i
666 0 0 if $first[1] =~ /inf/i or $first[1] =~ /nan/i
671 0 0 if ($mantissa eq '') { }
689 0 0 if length $_[0] != 128
696 0 0 substr($keep, 0, 1) ? :
697 0 0 if substr($keep, 1, 5) eq '11111'
698 0 0 if (substr($keep, 1, 5) eq '11110')
700 0 0 if ($pre eq '00' or $pre eq '01' or $pre eq '10')
706 0 0 if ($pre eq '1100' or $pre eq '1101' or $pre eq '1110')
719 0 0 if length $_[0] != 128
740 0 184729 if length $keep != 128
746 104288 80441 substr($keep, 0, 1) ? :
747 13 184716 if substr($keep, 1, 5) eq '11111'
748 25 184691 if (substr($keep, 1, 5) eq '11110')
750 184313 0 if ($pre eq '00' or $pre eq '01' or $pre eq '10')
756 936 183755 if (not $mantissa =~ /[1-9]/) { }
766 0 0 if ($pre eq '1100' or $pre eq '1101' or $pre eq '1110')
772 0 0 if (not $mantissa =~ /[1-9]/) { }
823 0 0 if ($arg1 =~ /^(\-|\+)?inf|^(\-|\+)?nan/i)
836 8 8 if ($arg1 =~ /^(\-|\+)?inf|^(\-|\+)?nan/i)
849 0 0 unless defined $_[1]
852 0 0 unless defined $split[1]
864 0 9724 if ($Math::Decimal128::fmt eq 'DPD') { }
865 0 0 if ($pre eq '00' or $pre eq '01' or $pre eq '10') { }
873 9724 0 if ($pre eq '00' or $pre eq '01' or $pre eq '10') { }
886 2414 2448 if hex substr(d128_bytes($_[0]), 0, 1) >= 8
920 12 0 if ($man =~ /^(\-|\+)?inf|^(\-|\+)?nan/i)
921 6 4 $man =~ /^(\-|\+)?nan/i ? :
2 10 $man =~ /\-inf/i ? :
929 0 0 $man =~ /^\-/ ? :
931 0 0 if $man =~ /[^0-9]/
937 0 0 unless $man
944 0 0 if (length $man > 34 or $exp < -6176)
945 0 0 if length $man > 34
951 0 0 if $exp < -6176
954 0 0 if ($exp > 6111)
955 0 0 if length($man) + $exp > 6145
968 0 0 if $len != 110
975 0 0 if ($leading_digit < 8) { }
980 0 0 $leading_digit == 8 ? :
985 0 0 if $len != 17
997 11 1730 if is_NaND128($_[0])
998 22 1708 if (is_InfD128($_[0]))
999 11 11 if is_InfD128($_[0]) > 0
1002 635 1073 if $e >= 0
1005 537 536 if ($len != length $m)
1009 271 802 if ($len + $e > 0)
1013 758 44 if ($len + $e < 0)
1026 1 122 unless $_[1] >= 0
1029 98 24 $_[1] ? :
1033 30 92 if $str =~ /n/i
1035 8 84 unless $str =~ /\./
1040 18 66 if $_[1] == $len_trail
1042 14 52 if (length $trailing <= $_[1])
1050 18 34 if substr($trailing, $_[1], 1) <= 4 or substr($trailing, $_[1]) =~ /^5(0+)?$/ and substr($trailing, $_[1] - 1, 1) % 2 == 0
1059 10 24 if $carry eq ''
1066 12 12 if ($len_lead != length $leading)
1085 30 22 if (substr($_[0], $offset, 1) ne '0')