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 atuccia, eric.smith, steven.daprano
Date 2020-10-25.23:55:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1603670113.47.0.983064826631.issue42148@roundup.psfhosted.org>
In-reply-to
Content
Eric I would normally agree with you but the only thing which gives me pause is the statement that this doesn't occur with C, Lua and Perl.

That alone doesn't mean much. Different interpreters can use different algorithms for printing floats, Python changed its algorithm in 3.1 and backported it to 2.7:

https://docs.python.org/3.1/whatsnew/3.1.html#other-language-changes

and now uses Gay's algorithm which will often give different, shorter, results than other algorithms. Other languages do other things, for example R is notorious for just terminating the float output after a few decimal places, so you have numbers which look identical but are unequal.

Andrea, do you still think this is a bug? Can you demonstrate some code in another language that shows the output you expect? (Preferably an interpreter rather than C.)

Most importantly, can you demonstrate that the other language's output is correct and Python's is wrong? In particular, are you sure that the output in those other languages is not just rounding the result to a certain number of decimal places?

If you can satisfy those, please re-open the ticket, otherwise I expect that Eric is correct.
History
Date User Action Args
2020-10-25 23:55:13steven.dapranosetrecipients: + steven.daprano, eric.smith, atuccia
2020-10-25 23:55:13steven.dapranosetmessageid: <1603670113.47.0.983064826631.issue42148@roundup.psfhosted.org>
2020-10-25 23:55:13steven.dapranolinkissue42148 messages
2020-10-25 23:55:13steven.dapranocreate