8245: improve Rational comparisons

fixes #8245