New submission from Tony <[email protected]>:
on the >>> prompt type:
>>>717161 * 0.01
7171.610000000001
the same goes for
>>>717161.0 * 0.01
7171.610000000001
You can easily find more numbers with similar problem:
for i in range(1000000):
if len(str(i * 0.01)) > 12:
print(i, i * 0.01)
I am sure, that this problem was found before and circumvented by:
>>>717161 / 100
7171.61
but this is hardly the way, one wants to rely on the code.
This is the python version I use:
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit
(AMD64)] on win32
----------
messages: 387485
nosy: tonys_0
priority: normal
severity: normal
status: open
title: elementary multiplication by 0.01 error
type: behavior
versions: Python 3.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue43291>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com