Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:

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.

----------
nosy: +steven.daprano

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42148>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to