http://www.perlmonks.org?node_id=11130786


in reply to [Raku] Arcane treatment of doubles and rationals

display the fact that the (double precision) values held by $d_1 and $d_2 are exactly equivalent to the rational value 3602879701896397/36028797018963968
I think your assumption is wrong.
$ say 3602879701896397/36028797018963968 == 0.100000000000000006; True $ say 10000000000000001/100000000000000000 == 0.10000000000000001 == 0 +.10000000000000001e0 == 0.1 + 1e-18; True

== and the other operators don't care about the type of the number they work with, they will coerce every operand to Num anyway. However
$ say 3602879701896397/36028797018963968 =~= 0.10000000000000001; True
There is also a unicode variant of the approximately-equal operator but it won't display correctly here.


holli

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