Condition Coverage

blib/lib/Math/BigRat.pm
Criterion Covered Total %
condition 227 393 57.7


and 3 conditions

line !l l&&!r l&&r condition
101 0 0 0 defined $cmp && $_[2]
268 10 19659 1 @_ == 1 and not defined $n
0 0 10 defined $n && defined $d
19659 10 0 @_ == 2 and not defined $n && defined $d
310 0 0 0 defined $downgrade and $n->is_int
351 12643 1 5 defined $downgrade and $n->is_int
361 5 1 401 ref $d and $d->isa('Math::BigRat') || $d->isa('Math::BigInt') || $d->isa('Math::BigFloat')
437 0 0 0 defined $downgrade and $self->is_int
544 0 0 0 defined $downgrade and $self->is_int
603 16 384 351 defined $sign && substr($sign, 0, 1) eq '-'
627 5 6 2 defined $sign and $sign eq "-"
666 5 1 6 @_ == 1 and ref $_[0] ne "HASH"
766 17 7 2 $x->{'sign'} eq "+" and $LIB->_is_zero($x->{'_n'})
769 20 2 4 defined $downgrade and $LIB->_is_one($x->{'_d'})
835 128 74 123 $x->is_finite and $y->is_finite
890 28 56 7 $x->{'sign'} eq "+" and $x->is_zero
893 61 14 16 $x->{'sign'} eq "+" and $x->is_zero
916 4 4 5 $x->{'sign'} =~ /^\+/ and $y->{'sign'} =~ /^\+/
917 4 2 2 $x->{'sign'} =~ /^-/ and $y->{'sign'} =~ /^-/
1001 8 0 0 defined $downgrade and $quo->is_int
1003 5 3 0 $wantarray and defined $downgrade
8 0 0 $wantarray and defined $downgrade and $rem->is_int
1022 0 0 0 defined $downgrade and $quo->is_int
1024 0 0 0 $wantarray and defined $downgrade
0 0 0 $wantarray and defined $downgrade and $rem->is_int
1043 0 0 0 defined $downgrade and $quo->is_int
1045 0 0 0 defined $downgrade and $rem->is_int
1091 6 0 0 defined $downgrade and $x->is_int
1092 6 0 0 defined $downgrade and $rem->is_int
1137 0 0 0 defined $downgrade and $x->is_int
1232 7 24 9789 $x->{'sign'} =~ /^[+-]$/ and $LIB->_is_one($x->{'_d'})
1240 159 417 73 $x->{'sign'} eq "+" and $LIB->_is_zero($x->{'_n'})
1252 134 119 58 $x->{'sign'} eq $sign and $LIB->_is_one($x->{'_n'})
253 21 37 $x->{'sign'} eq $sign and $LIB->_is_one($x->{'_n'}) and $LIB->_is_one($x->{'_d'})
1261 4 7 10 $LIB->_is_one($x->{'_d'}) and $LIB->_is_odd($x->{'_n'})
4 10 11 $x->{'sign'} =~ /^[+-]$/ and ($LIB->_is_one($x->{'_d'}) and $LIB->_is_odd($x->{'_n'}))
1271 4 5 6 $LIB->_is_one($x->{'_d'}) and $LIB->_is_even($x->{'_n'})
1392 8 4 2 $x->{'sign'} eq "-" and $LIB->_is_zero($x->{'_n'})
1426 410 0 1 $x->{'sign'} eq "-" and $LIB->_is_zero($x->{'_n'})
1472 3 4 3 $x > -1 and $x < 1
1477 3 4 3 $x > -1 and $x < 1
1490 47 35 20 $x->is_negative and not $y->is_int
1511 27 8 12 $x->{'sign'} eq "-" and $LIB->_is_even($y->{'_n'})
1532 20 0 0 not ref $_[0] and $_[0] =~ /^[A-Za-z]|::/
1567 2 0 0 defined $base && $base < 1
1574 2 1 0 defined $base && $base < 1
1589 1 0 2 defined &blessed($base) and $base->isa($class)
1717 72 4860 0 $x->is_finite and not $x->is_int
72 4860 0 $y->is_finite and not $y->is_int
1862 0 0 0 ref $b and $b->isa($class)
1876 0 0 0 ref $b and $b->isa($class)
1985 1235 2 0 defined $downgrade and $x->is_int || $x->is_inf || $x->is_nan
1992 0 0 4 defined $downgrade and $x->is_int || $x->is_inf || $x->is_nan
1999 0 0 4 defined $downgrade and $x->is_int || $x->is_inf || $x->is_nan
2018 0 0 54 $x->{'sign'} =~ /^[+-]$/ and $y->{'sign'} =~ /^[+-]$/
2022 0 0 0 $x->{'sign'} eq $y->{'sign'} and $x->{'sign'} =~ /^[+-]inf$/
2034 20 20 14 $x->{'sign'} eq "+" and $y->{'sign'} eq "-"
2036 20 15 5 $x->{'sign'} eq "-" and $y->{'sign'} eq "+"
2043 32 3 0 $xz and $yz
2044 32 0 3 $xz and $y->{'sign'} eq "+"
2045 32 0 0 $yz and $x->{'sign'} eq "+"
2065 22 13 15 $x->{'sign'} =~ /^[+-]$/ and $y->{'sign'} =~ /^[+-]$/
2068 12 12 4 $x->{'sign'} =~ /^[+-]inf$/ and $y->{'sign'} =~ /^[+-]inf$/
2069 12 0 12 $x->{'sign'} =~ /^[+-]inf$/ and not $y->{'sign'} =~ /^[+-]inf$/
2087 0 8 2 defined $cmp && !$cmp
2099 0 0 0 defined $cmp && !$cmp
2111 0 10 9 defined $cmp && $cmp < 0
2123 0 0 0 defined $cmp && $cmp <= 0
2135 0 10 14 defined $cmp && $cmp > 0
2148 0 0 0 defined $cmp && $cmp >= 0

or 2 conditions

line l !l condition
664 12 0 shift() || 'Math::BigRat'
1249 198 113 $_[1] || ''
1373 9 2 $n || 0

or 3 conditions

line l !l&&r !l&&!r condition
245 0 19671 0 $protoref || $proto
268 1 0 19669 @_ == 1 and not defined $n or @_ == 2 and not defined $n && defined $d
282 0 5818 10 $n->isa("Math::BigRat") or $n->isa("Math::BigInt")
5818 10 0 $n->isa("Math::BigRat") or $n->isa("Math::BigInt") or $n->isa("Math::BigFloat")
361 5 397 0 $d->isa('Math::BigRat') || $d->isa('Math::BigInt') || $d->isa('Math::BigFloat')
368 3 0 404 $n->is_nan or $d->is_nan
552 1319 0 0 $selfref || $self
575 193 344 0 $selfref || $self
598 175 576 0 $selfref || $self
624 12 1 0 $selfref || $self
645 32 30 0 $selfref || $self
831 0 91 234 not ref $_[0] or ref $_[0] ne ref $_[1]
836 34 28 140 $x->is_nan or $y->is_nan
884 0 5 86 not ref $_[0] or ref $_[0] ne ref $_[1]
904 0 6 87 not ref $_[0] or ref $_[0] ne ref $_[1]
908 5 3 85 $x->{'sign'} eq "NaN" or $y->{'sign'} eq "NaN"
911 9 4 72 $x->{'sign'} =~ /^[+-]inf$/ or $y->{'sign'} =~ /^[+-]inf$/
912 0 0 13 $x->is_zero or $y->is_zero
962 0 7 80 not ref $_[0] or ref $_[0] ne ref $_[1]
974 2 3 82 $x->is_nan or $y->is_nan
1036 0 0 0 $x->is_zero or $x->bcmp(0) == $y->bcmp(0)
1050 0 0 2 $x->is_nan or $x->is_inf
1105 0 0 21 not ref $_[0] or ref $_[0] ne ref $_[1]
1114 1 1 19 $x->is_nan or $y->is_nan
1136 0 0 0 $x->is_zero or $x->bcmp(0) == $y->bcmp(0)
1382 5 5 14 not $x->{'sign'} =~ /^[+-]$/ or $LIB->_is_one($x->{'_d'})
1400 5 19 28 not $x->{'sign'} =~ /^[+-]$/ or $LIB->_is_one($x->{'_d'})
1417 24 528 411 not $x->{'sign'} =~ /^[+-]$/ or $LIB->_is_one($x->{'_d'})
1435 3 0 10 $x->{'sign'} ne "+" or not $LIB->_is_one($x->{'_d'})
1451 0 6 184 not ref $_[0] or ref $_[0] ne ref $_[1]
1458 15 14 161 $x->is_nan or $y->is_nan
1496 11 9 62 $x->is_one("+") or $y->is_one
1551 2 0 5 $base->is_nan or $base->is_one
0 0 5 $base->is_inf or $base->is_zero
1554 0 0 0 $x->is_inf or $x->is_zero
1617 0 1 0 not ref $_[0] or ref $_[0] ne ref $_[1]
1642 0 0 0 $params[0] or $params[1]
1712 0 2478 2478 not ref $_[0] or ref $_[0] ne ref $_[1]
1716 16 8 4932 $x->is_nan or $y->is_nan
1717 0 0 4932 $x->is_finite and not $x->is_int or $y->is_finite and not $y->is_int
1736 0 5 2 not ref $_[0] or ref $_[0] ne ref $_[1]
1768 0 0 19 not ref $_[0] or ref $_[0] ne ref $_[1]
1791 0 0 17 not ref $_[0] or ref $_[0] ne ref $_[1]
1814 1 1 13 $x->is_zero or $x->is_one
1864 0 0 0 $x->is_nan or $y->is_nan
0 0 0 $x->is_nan or $y->is_nan or $b->is_nan
1878 0 0 0 $x->is_nan or $y->is_nan
0 0 0 $x->is_nan or $y->is_nan or $b->is_nan
1891 289 0 0 $xref || $x
1915 289 0 0 $xref || $x
1939 289 0 0 $xref || $x
1963 0 0 0 $xref || $x
1985 2 0 0 $x->is_int || $x->is_inf || $x->is_nan
1992 3 1 0 $x->is_int || $x->is_inf || $x->is_nan
1999 3 1 0 $x->is_int || $x->is_inf || $x->is_nan
2014 0 36 18 not ref $_[0] or ref $_[0] ne ref $_[1]
2020 0 0 0 $x->{'sign'} eq $nan or $y->{'sign'} eq $nan
2061 0 0 50 not ref $_[0] or ref $_[0] ne ref $_[1]
2067 4 3 28 $x->{'sign'} eq $nan or $y->{'sign'} eq $nan