Hacker News new | ask | show | jobs
by masklinn 2490 days ago
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

1 comments

That's the first thing I'd try, multiply by 10^digits, round, divide by 10^digits. Thanks for the link.