[issue37168] Decimal divisions sometimes 10x or 100x too large

Stefan Krah report at bugs.python.org
Wed Jun 5 19:02:40 EDT 2019


Stefan Krah <stefan at bytereef.org> added the comment:

Thank you for the detailed report. So, in an attempt to summarize,
this is the crucial passage:

>>> ideal_exp = -1
>>> exp = -29
>>> coeff = 150000000000000000000000000000
>>> division_counter = 0
>>> while exp < ideal_exp and coeff % 10 == 0:
...     coeff //= 10
...     exp += 1
...     division_counter += 1
... 
>>> coeff
15L
>>> exp
-1
>>> division_counter
28



But you sometimes get coeff==150 and division_counter==27 instead.
Is that correct?


The first thing to consider is whether Alpine Linux uses a patched
Python version or if you can reproduce this on Python 2.7.15 compiled
from source.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37168>
_______________________________________


More information about the Python-bugs-list mailing list