We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The &infix:<==>(Rational:D \a, Rational:D \b) candidate doesn't handle Inf.Rat properly.
&infix:<==>(Rational:D \a, Rational:D \b)
Inf.Rat
1/0 == 1/3; # True 1/3 == 1/0; # True
Since both Inf.Rat and NaN.Rat have zero for a denominator, the following gets to the code marked with # NaN != NaN.
NaN.Rat
# NaN != NaN
multi sub infix:<==>(Rational:D \a, Rational:D \b) { nqp::hllbool( nqp::isfalse(a.denominator) || nqp::isfalse(b.denominator) ?? nqp::iseq_I(a.numerator, b.numerator) && nqp::istrue(a.numerator) # NaN != NaN !! nqp::iseq_I( nqp::mul_I(a.numerator, b.denominator, Int), nqp::mul_I(b.numerator, a.denominator, Int))) }
The text was updated successfully, but these errors were encountered:
Fixed with c11e7e6 .
Sorry, something went wrong.
Tests added with Raku/roast@6feffac83c
No branches or pull requests
The Problem
The
&infix:<==>(Rational:D \a, Rational:D \b)
candidate doesn't handleInf.Rat
properly.Since both
Inf.Rat
andNaN.Rat
have zero for a denominator, the following gets to the code marked with# NaN != NaN
.The text was updated successfully, but these errors were encountered: