Yes, sure, this is not satisfactory, but the bottom line, in C, in Perl and in most other programming languages, is that you should not compare floats for equality (unless you really know very well what you're doing). To check is two such numbers shall be deemed equal, one should check that the absolute value of their difference is smaller than a certain very small value.
Perl 6 has a rational type, in which numbers are stored internally as a numerator and a denominator, allowing for accurate comparison of decimal numbers.
| [reply] |
Yeah just updated it before I saw your reply.
I think the way -48.48 is transformed into a float follows a different calculation path which rounds the last bit into another direction.
| [reply] |