in reply to Small Perl 6 discoveries III, Ints

The exponential notation always produces a Num (and therefore introduces rounding errors), even when a value could be expressed as a Rat. This is by design as I have been told. It works correctly though if you do this:
> 2*(10**25) 20000000000000000000000000 > 20*(10**24) 20000000000000000000000000 > 2*(10**25) == 20*(10**24) True


holli

You can lead your users to water, but alas, you cannot drown them.

Replies are listed 'Best First'.
Re^2: Small Perl 6 discoveries III, Ints
by Anonymous Monk on Sep 29, 2017 at 05:56 UTC
    Yes, thanks. We've discovered that the Int is actually working correctly in this case, but the Num is broken.
      It's not broken. It's just a floating point number.


      holli

      You can lead your users to water, but alas, you cannot drown them.
        If you take the simplistic point of view that "floating point numbers just give the wrong answer sometimes," you might come to that conclusion. But floating point numbers actually follow very specific rules, which are being broken here.