[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

Stefan Krah report at bugs.python.org
Fri Feb 7 10:35:16 EST 2020


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

MAX_PREC is chosen so that 5*MAX_PREC does not overflow 32-bit or 64-bit signed integers. This eliminates many overflow checks for the exponent.

Updating the exponent is (perhaps surprisingly) quite performance sensitive, that's why the 32-bit build does not use a 64-bit exponent.

----------

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


More information about the Python-bugs-list mailing list