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 atuccia
Recipients atuccia
Date 2020-10-25.16:49:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1603644596.05.0.306482715682.issue42148@roundup.psfhosted.org>
In-reply-to
Content
I'm noticing some floating point representation precision issues that occurs on all versions and platforms:

>>> 277*0.1
27.700000000000003
>>> 1.2-1.0
0.19999999999999996
>>> import numpy as np
>>> np.double(277*0.1)
27.700000000000003
>>> np.double(1.2-1.0)
0.19999999999999996
>>> np.longdouble(277*0.1)
27.700000000000002842
>>> np.longdouble(1.2-1.0)
0.19999999999999995559

Verified with python 2.7 to 3.8. On x86 (i386 and amd64) and ARM (32 and 64 bits). It does not occur in C, LUA, Perl, ...
History
Date User Action Args
2020-10-25 16:49:56atucciasetrecipients: + atuccia
2020-10-25 16:49:56atucciasetmessageid: <1603644596.05.0.306482715682.issue42148@roundup.psfhosted.org>
2020-10-25 16:49:56atuccialinkissue42148 messages
2020-10-25 16:49:55atucciacreate