in reply to Small Perl 6 discoveries III, Ints
It happens because 20e24 is miscalculated (off by one ULP). It's an error that doesn't occur on all of my "double" perls. For example, my perl-5.16.0 is not subject to this issue.C:\>perl -le "printf '%.0f', 2e25;" 20000000000000001811939328 C:\>perl -le "printf '%.0f', 20e24;" 19999999999999997516972032
$ perl -le 'printf "%.0f\n", 2e25;' 20000000000000001811939328 $ perl -le "printf '%.0f', 20e24;" 19999999999999997516972032
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Small Perl 6 discoveries III, Ints
by Anonymous Monk on Sep 29, 2017 at 00:28 UTC |