fix float vs rational comparisons

This (should) fix `FloatingPoint` vs `Rational` comparisons (mentioned in #2960 and #8411), and should be easily extendable to other binary `Real` types such as [FixedPointNumbers.jl](https://github.com/JeffBezanson/FixedPointNumbers.jl).

It does change the dispatch of comparison operators considerably, so there is a chance that this could break something, or cause a performance regression.
Good catch, thanks.