This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients Petr Pisl, mrabarnett, steven.daprano
Date 2020-01-23.20:34:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1579811690.86.0.108196601799.issue39436@roundup.psfhosted.org>
In-reply-to
Content
Further to what Matthew said, this is not just a Python oddity. It applies to just about all programming languages, including C, C++, Java, Javascript, Ruby, etc. Some of them have even less precision by default.

Floats are not the same as the real numbers you learned about in school. There is a huge amount of resources about the limitations of floating point arithmetic on Stackoverflow etc which can be found by googling. A good place to start is the Python FAQs and tutorial:

https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate

https://docs.python.org/3/tutorial/floatingpoint.html#tut-fp-issues
History
Date User Action Args
2020-01-23 20:34:50steven.dapranosetrecipients: + steven.daprano, mrabarnett, Petr Pisl
2020-01-23 20:34:50steven.dapranosetmessageid: <1579811690.86.0.108196601799.issue39436@roundup.psfhosted.org>
2020-01-23 20:34:50steven.dapranolinkissue39436 messages
2020-01-23 20:34:50steven.dapranocreate