Condition Coverage

blib/lib/Math/BigRat.pm
Criterion Covered Total %
condition 233 393 59.2


and 3 conditions

line !l l&&!r l&&r condition
101 0 0 0 defined $cmp && $_[2]
262 10 19859 1 @_ == 1 and not defined $n
0 0 10 defined $n && defined $d
19859 10 0 @_ == 2 and not defined $n && defined $d
304 0 0 0 defined $downgrade and $n->is_int
348 12653 1 5 defined $downgrade and $n->is_int
359 5 1 401 ref $d and $d->isa('Math::BigRat') || $d->isa('Math::BigInt') || $d->isa('Math::BigFloat')
435 0 0 0 defined $downgrade and $self->is_int
542 0 0 0 defined $downgrade and $self->is_int
601 16 412 355 defined $sign && substr($sign, 0, 1) eq '-'
625 5 6 2 defined $sign and $sign eq "-"
664 5 1 6 @_ == 1 and ref $_[0] ne "HASH"
764 17 7 2 $x->{'sign'} eq "+" and $LIB->_is_zero($x->{'_n'})
767 20 2 4 defined $downgrade and $LIB->_is_one($x->{'_d'})
784 128 74 128 $x->is_finite and $y->is_finite
839 28 56 12 $x->{'sign'} eq "+" and $x->is_zero
842 61 14 21 $x->{'sign'} eq "+" and $x->is_zero
865 4 4 5 $x->{'sign'} =~ /^\+/ and $y->{'sign'} =~ /^\+/
866 4 2 2 $x->{'sign'} =~ /^-/ and $y->{'sign'} =~ /^-/
950 8 0 0 defined $downgrade and $quo->is_int
952 5 3 0 $wantarray and defined $downgrade
8 0 0 $wantarray and defined $downgrade and $rem->is_int
971 0 0 0 defined $downgrade and $quo->is_int
973 0 0 0 $wantarray and defined $downgrade
0 0 0 $wantarray and defined $downgrade and $rem->is_int
992 0 0 0 defined $downgrade and $quo->is_int
994 0 0 0 defined $downgrade and $rem->is_int
1040 6 0 0 defined $downgrade and $x->is_int
1041 6 0 0 defined $downgrade and $rem->is_int
1086 0 0 0 defined $downgrade and $x->is_int
1181 7 24 9789 $x->{'sign'} =~ /^[+-]$/ and $LIB->_is_one($x->{'_d'})
1189 159 417 83 $x->{'sign'} eq "+" and $LIB->_is_zero($x->{'_n'})
1201 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'})
1210 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'}))
1220 4 5 6 $LIB->_is_one($x->{'_d'}) and $LIB->_is_even($x->{'_n'})
1341 8 4 2 $x->{'sign'} eq "-" and $LIB->_is_zero($x->{'_n'})
1375 410 0 1 $x->{'sign'} eq "-" and $LIB->_is_zero($x->{'_n'})
1421 3 4 3 $x > -1 and $x < 1
1426 3 4 3 $x > -1 and $x < 1
1439 47 35 20 $x->is_negative and not $y->is_int
1460 27 8 12 $x->{'sign'} eq "-" and $LIB->_is_even($y->{'_n'})
1481 20 0 0 not ref $_[0] and $_[0] =~ /^[A-Za-z]|::/
1516 2 0 0 defined $base && $base < 1
1523 2 1 0 defined $base && $base < 1
1538 1 0 2 defined &blessed($base) and $base->isa($class)
1666 72 4860 0 $x->is_finite and not $x->is_int
72 4860 0 $y->is_finite and not $y->is_int
1811 0 0 0 ref $b and $b->isa($class)
1825 0 0 0 ref $b and $b->isa($class)
1934 1250 2 0 defined $downgrade and $x->is_int || $x->is_inf || $x->is_nan
1941 0 0 4 defined $downgrade and $x->is_int || $x->is_inf || $x->is_nan
1948 0 0 4 defined $downgrade and $x->is_int || $x->is_inf || $x->is_nan
1967 16 0 138 $x->{'sign'} =~ /^[+-]$/ and $y->{'sign'} =~ /^[+-]$/
1971 0 0 16 $x->{'sign'} eq $y->{'sign'} and $x->{'sign'} =~ /^[+-]inf$/
1983 29 95 14 $x->{'sign'} eq "+" and $y->{'sign'} eq "-"
1985 95 18 11 $x->{'sign'} eq "-" and $y->{'sign'} eq "+"
1992 55 3 55 $xz and $yz
1993 55 0 3 $xz and $y->{'sign'} eq "+"
1994 55 0 0 $yz and $x->{'sign'} eq "+"
2014 22 13 15 $x->{'sign'} =~ /^[+-]$/ and $y->{'sign'} =~ /^[+-]$/
2017 12 12 4 $x->{'sign'} =~ /^[+-]inf$/ and $y->{'sign'} =~ /^[+-]inf$/
2018 12 0 12 $x->{'sign'} =~ /^[+-]inf$/ and not $y->{'sign'} =~ /^[+-]inf$/
2036 0 8 2 defined $cmp && !$cmp
2048 0 0 0 defined $cmp && !$cmp
2060 0 15 9 defined $cmp && $cmp < 0
2072 0 0 0 defined $cmp && $cmp <= 0
2084 0 15 14 defined $cmp && $cmp > 0
2097 0 0 0 defined $cmp && $cmp >= 0

or 2 conditions

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

or 3 conditions

line l !l&&r !l&&!r condition
239 0 19871 0 $protoref || $proto
262 1 0 19869 @_ == 1 and not defined $n or @_ == 2 and not defined $n && defined $d
276 0 6008 10 $n->isa("Math::BigRat") or $n->isa("Math::BigInt")
6008 10 0 $n->isa("Math::BigRat") or $n->isa("Math::BigInt") or $n->isa("Math::BigFloat")
359 5 397 0 $d->isa('Math::BigRat') || $d->isa('Math::BigInt') || $d->isa('Math::BigFloat')
366 3 0 404 $n->is_nan or $d->is_nan
550 1319 0 0 $selfref || $self
573 193 344 0 $selfref || $self
596 175 608 0 $selfref || $self
622 12 1 0 $selfref || $self
643 32 30 0 $selfref || $self
780 0 91 239 not ref $_[0] or ref $_[0] ne ref $_[1]
785 34 28 140 $x->is_nan or $y->is_nan
833 5 5 86 not ref $_[0] or ref $_[0] ne ref $_[1]
853 0 6 87 not ref $_[0] or ref $_[0] ne ref $_[1]
857 5 3 85 $x->{'sign'} eq "NaN" or $y->{'sign'} eq "NaN"
860 9 4 72 $x->{'sign'} =~ /^[+-]inf$/ or $y->{'sign'} =~ /^[+-]inf$/
861 0 0 13 $x->is_zero or $y->is_zero
911 0 7 80 not ref $_[0] or ref $_[0] ne ref $_[1]
923 2 3 82 $x->is_nan or $y->is_nan
985 0 0 0 $x->is_zero or $x->bcmp(0) == $y->bcmp(0)
999 0 0 2 $x->is_nan or $x->is_inf
1054 0 0 21 not ref $_[0] or ref $_[0] ne ref $_[1]
1063 1 1 19 $x->is_nan or $y->is_nan
1085 0 0 0 $x->is_zero or $x->bcmp(0) == $y->bcmp(0)
1331 5 5 14 not $x->{'sign'} =~ /^[+-]$/ or $LIB->_is_one($x->{'_d'})
1349 5 19 28 not $x->{'sign'} =~ /^[+-]$/ or $LIB->_is_one($x->{'_d'})
1366 24 528 411 not $x->{'sign'} =~ /^[+-]$/ or $LIB->_is_one($x->{'_d'})
1384 3 0 10 $x->{'sign'} ne "+" or not $LIB->_is_one($x->{'_d'})
1400 0 6 184 not ref $_[0] or ref $_[0] ne ref $_[1]
1407 15 14 161 $x->is_nan or $y->is_nan
1445 11 9 62 $x->is_one("+") or $y->is_one
1500 2 0 5 $base->is_nan or $base->is_one
0 0 5 $base->is_inf or $base->is_zero
1503 0 0 0 $x->is_inf or $x->is_zero
1566 0 1 0 not ref $_[0] or ref $_[0] ne ref $_[1]
1591 0 0 0 $params[0] or $params[1]
1661 0 2478 2478 not ref $_[0] or ref $_[0] ne ref $_[1]
1665 16 8 4932 $x->is_nan or $y->is_nan
1666 0 0 4932 $x->is_finite and not $x->is_int or $y->is_finite and not $y->is_int
1685 0 5 2 not ref $_[0] or ref $_[0] ne ref $_[1]
1717 0 0 19 not ref $_[0] or ref $_[0] ne ref $_[1]
1740 0 0 17 not ref $_[0] or ref $_[0] ne ref $_[1]
1763 1 1 13 $x->is_zero or $x->is_one
1813 0 0 0 $x->is_nan or $y->is_nan
0 0 0 $x->is_nan or $y->is_nan or $b->is_nan
1827 0 0 0 $x->is_nan or $y->is_nan
0 0 0 $x->is_nan or $y->is_nan or $b->is_nan
1840 289 0 0 $xref || $x
1864 289 0 0 $xref || $x
1888 289 0 0 $xref || $x
1912 0 0 0 $xref || $x
1934 2 0 0 $x->is_int || $x->is_inf || $x->is_nan
1941 3 1 0 $x->is_int || $x->is_inf || $x->is_nan
1948 3 1 0 $x->is_int || $x->is_inf || $x->is_nan
1963 90 46 18 not ref $_[0] or ref $_[0] ne ref $_[1]
1969 0 0 16 $x->{'sign'} eq $nan or $y->{'sign'} eq $nan
2010 0 0 50 not ref $_[0] or ref $_[0] ne ref $_[1]
2016 4 3 28 $x->{'sign'} eq $nan or $y->{'sign'} eq $nan