Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
Please forgive me if my answer is a little bit brusque, but we get essentially this same bug report regularly, only the numbers are different. This is not a bug in Python, it is an unavoidable consequence of how floating point arithmetic works in every single programming language that does floating point arithmetic. There's a FAQ about it: https://docs.python.org/3/faq/design.html#why-am-i-getting-strange-results-with-simple-arithmetic-operations it's discussed in the tutorial: https://docs.python.org/3/tutorial/floatingpoint.html#tut-fp-issues there's probably a million websites, blog posts, Stackoverflow questions etc about it, and computer scientists write papers about it: https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41920> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com