News for hackers. Stuff that matters.
Re:Python rounds float values by converting them to string a... by bottled_poe on Wednesday August 28, 2019 @06:44AM (#20818483)
The two concerns I have are performance and correctness. I don’t know enough about the implementation of round(3) to know... perhaps someone else does?
Re:Python rounds float values by converting them to string a... by dagw on Wednesday August 28, 2019 @07:01AM (#20818576)
This approach is used specifically because of correctness. Doing things the 'obvious' way with round(3) or truncation introduces precision problems in corner cases.