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 xtreak
Recipients docs@python, rhettinger, xtreak
Date 2018-10-09.10:06:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1539079611.42.0.545547206417.issue34942@psf.upfronthosting.co.za>
In-reply-to
Content
There have been tickets raised due to floating point representation being misleading where "0.1 + 0.2" returns 0.30000000000000004 and "0.1 + 0.3" returns 0.4. This is explained at [0] but I think it's worth to add this as a question to FAQ and link to the tutorial and possibly to some external links like [1] and [2] so that the user can understand the limitation instead of assuming it's a bug in CPython. Searching for "floatingpoint.html" gives 64 issues [4] were the documentation was linked out of which 3 were reported in the past one month.

If there is also any other page where this can be linked to get better visibility then this could avoid a lot of confusion especially for beginners where "0.1 + 0.3" silently seems to work fine but "0.1 + 0.2" has a misleading representation along with variations in other floating point arithmetic operations making the user think it's a CPython bug.

Adding Raymond to see if it's worth adding it in FAQ or any other place and also that he might have more feedback on teaching users and wording this in a better way.

[0] https://docs.python.org/3/tutorial/floatingpoint.html
[1] https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
[2] https://0.30000000000000004.com/
[4] https://bugs.python.org/issue?%40columns=id%2Cactivity%2Ctitle%2Ccreator%2Cassignee%2Cstatus%2Ctype&%40sort=-activity&%40filter=status&%40action=searchid&ignore=file%3Acontent&%40search_text=floatingpoint.html&submit=search&status=-1%2C1%2C2%2C3
History
Date User Action Args
2018-10-09 10:06:51xtreaksetrecipients: + xtreak, rhettinger, docs@python
2018-10-09 10:06:51xtreaksetmessageid: <1539079611.42.0.545547206417.issue34942@psf.upfronthosting.co.za>
2018-10-09 10:06:51xtreaklinkissue34942 messages
2018-10-09 10:06:51xtreakcreate