in reply to Re^12: Small Perl 6 discoveries II, Rats
in thread [Perl6] Small discoveries I, __DATA__

In your first block of code you do a calculation whose resulting denominator is more than 64 bits. So the result is a Num.

Your second block shows BUG Num.FatRat coercion is inexact.

Your third block is an LTA error message. It should say something to the effect of "coercion type constraint on variable declaration not yet implemented".

Hth.

  • Comment on Re^13: Small Perl 6 discoveries II, Rats

Replies are listed 'Best First'.
Re^14: Small Perl 6 discoveries II, Rats
by Anonymous Monk on Oct 28, 2017 at 06:35 UTC
    In your first block of code you do a calculation whose resulting denominator is more than 64 bits. So the result is a Num.
    So what you're telling me is that it's "working as designed"? There seems to be no way to get exact rational calculations without scattering a bunch of explicit FatRat conversions through my code. If I slip up somewhere, Perl6 will either hit me with a sneaky type error, or (worse) silently reduce precision on me.
    Your third block is an LTA error message.
    Lighter Than Air? Lawn Tennis Association? Long-Term Abuse?