Re:Python rounds float values by converting them to string a...
by f00zz on Wednesday August 28, 2019 @06:37AM
(#20818451)
That's what round(3) is for
[ Parent
| on HN ]
Re:Python rounds float values by converting them to string a...
by masklinn on Wednesday August 28, 2019 @06:57AM
(#20818550)
round(3) can only round to an integer. Python's round works to an arbitrary decimal position.
It would previously scale up, round (ceil/floor really) then scale down. That turned out to induce severe precision issues: https://bugs.python.org/issue1869