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/36028797018963968I think your assumption is wrong.
$ say 3602879701896397/36028797018963968 == 0.100000000000000006; True $ say 10000000000000001/100000000000000000 == 0.10000000000000001 == 0 +.10000000000000001e0 == 0.1 + 1e-18; True
There is also a unicode variant of the approximately-equal operator but it won't display correctly here.$ say 3602879701896397/36028797018963968 =~= 0.10000000000000001; True
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: [Raku] Arcane treatment of doubles and rationals
by syphilis (Archbishop) on Apr 04, 2021 at 00:24 UTC | |
by holli (Abbot) on Apr 04, 2021 at 12:59 UTC | |
by syphilis (Archbishop) on Apr 04, 2021 at 13:26 UTC | |
by holli (Abbot) on Apr 04, 2021 at 13:34 UTC |