This is because the implementation of infix:<cmp>(Rat:D, Rat:D) is kind
of bad:

    multi sub infix:<cmp>(Rational:D \a, Rational:D \b) is default {
        a.Num cmp b.Num
    }

We'll have to do a proper comparison of rats, rather than convert to Num
which can give wrong results like this.

On 23/02/17 04:32, brian d foy (via RT) wrote:
> # New Ticket Created by  "brian d foy" 
> # Please include the string:  [perl #130845]
> # in the subject line of all future correspondence about this issue. 
> # <URL: https://rt.perl.org/Ticket/Display.html?id=130845 >
>
>
> Here's a curious change over in precision:
>
>     > 4.999999999999999 ~~ 0..^5
>     True
>     > 4.9999999999999999 ~~ 0..^5
>     False
>
> I figure this is an implementation detail that ties to storage, but
> one of the selling points of Perl 6 is that this sort of thing isn't
> a problem anymore.
>
>     > $*PERL
>     Perl 6 (6.c)
>     > $*VM
>     moar (2017.01)

Reply via email to