We don't bite newbies here... much | |
PerlMonks |
Re^3: Small Perl 6 discoveries II, Ratsby syphilis (Archbishop) |
on Oct 20, 2017 at 04:12 UTC ( [id://1201724]=note: print w/replies, xml ) | Need Help?? |
If you want arbitrary precision rational arithmetic, you can use a FatRat I didn't know about FatRats (yes, I know very little about perl6) - so I had a bit of a play (on rakudo-star-2017.07) and encountered confusing results: On the bases that $x-$y==0 and $x==$y one is led to believe that $x and $y are exactly equivalent. Yet, say() presents us with different values. Are the 2 rationals equivalent ? If so, then why does say() output different values ? If not, then why do both $x-$y==0 and $x==$y evaluate as "True" ? Interestingly, 1.11111111111111111604544 is the value of the double 1.1111111111111111 (16 decimal places) rounded to 23 decimals: Perhaps this ties in with: How does one coerce perl6 into displaying the actual numerator and denominator of these rationals ? Cheers, Rob
In Section
Meditations
|
|