|Pathologically Eclectic Rubbish Lister|
Please consider assisting them by taking the survey about your participation in the Perl/Raku community.
Considered ... and declined.
Raku provided the opportunity to drag perl into the 21st century but, in terms of the way that numbers are handled, they opted to stick with an approach that I would term "neanderthal".
So I quickly lost interest. (But that's only because the way that numbers are handled is important to me ... and I do realize that there are others with different priorities.)
To elaborate, here's the approach that python3 chose to follow:
And here's the approach that raku has elected to follow:
Sure, I get that both of the rationals (1/10 and 3602879701896397/36028797018963968) round to the same double precision floating point value - and that's why raku reports "True" in both instances.
But the thing is that the double 0.1 does have a precise and exact rational value - and that precise and exact rational value is 3602879701896397/36028797018963968 (or, in decimal, 0.1000000000000000055511151231257827021181583404541015625) and not the precise and exact rational value of 1/10 (in decimal, 0.1).
I don't know why raku has made this choice. Anyone ?
The most annoying thing about it is that it implies that (the rational) 1/10 == (the rational) 3602879701896397/36028797018963968 ... yet raku itself will tell you that isn't so (if you explicitly ask it about that).
I'm inclined to think that it was done simply to annoy me ... though, somewhere deep inside, I think that even I realize that I'm probably not quite that important ;-)