|The stupid question is the question not asked|
Re^2: int() functionby LanX (Cardinal)
|on Oct 24, 2020 at 16:05 UTC||Need Help??|
> It does that for all floating point values - always to 15 decimal digits (unless perl's nvtype is other than "double") and always for a dubious reason.
So the last two bits are used for error correction, since they don't suffice to encode another decimal digit.
Is it a good solution? Well I'd say appropriate for the era and not "for a dubious reason".
Are there better approaches? Sure, but they are harder to implement and would have been quite slow back in the days.
From my experience, >95% of the problems arise from calculating with currencies and the solution is obvious, calculate with integer cents and move the point only for output.
°) WP actually says 53 by using a spare bit redundancy , but tl;dr and this still fails to encode 16 decimals.