Actually, I was mistaken. The code i pointed at there already works for
this very case. observe:

    131338  timotimo │ m: say 4.999999999999999 cmp 5.0
    131338  +camelia │ rakudo-moar 1811b8: OUTPUT: «Less␤»

The real problem is this implementation of &infix:<cmp>:

    multi sub infix:<cmp>(Real:D \a, Real:D \b) {
           (nqp::istype(a, Rational) && nqp::isfalse(a.denominator))
        || (nqp::istype(b, Rational) && nqp::isfalse(b.denominator))
        ?? a.Bridge cmp b.Bridge
        !! a === -Inf || b === Inf
            ?? Less
            !! a === Inf || b === -Inf
                ?? More
                !! a.Bridge cmp b.Bridge
    }

going via .Bridge will turn the Rat to 5e0 and the comparison goes wrong.

Reply via email to