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 serhiy.storchaka
Recipients mark.dickinson, serhiy.storchaka
Date 2015-10-14.11:42:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1444822963.9.0.112952407665.issue25402@psf.upfronthosting.co.za>
In-reply-to
Content
Int to decimal string conversion (function long_to_decimal_string_internal() at Objects/longobject.c:1583) has a limitation. On 32-bit platform you can't convert integers larger than 2**2**31 (10**646456993). Proposed patch removes this limitation [*].

It also decreases memory requirements for intermediate buffer on 10%. The size of intermediate buffer (in digits) depends on the size of the integer. Unpatched:

For 15-bit digits: size*15/4/3 = size*1.25
For 30-bit digits: size*30/9/3 = size*1.11

Patched:
For 15-bit digits: size*15/4/3.3 = size*1.14
For 30-bit digits: size*30/9/3.3 = size*1.01


[*] Converting such large integers to decimal string can be not finished for reasonable time, because it has quadratic complexity. On my netbook the estimated time of calculating str(2**2**31) is 5 years. But this is different issue.
History
Date User Action Args
2015-10-14 11:42:43serhiy.storchakasetrecipients: + serhiy.storchaka, mark.dickinson
2015-10-14 11:42:43serhiy.storchakasetmessageid: <1444822963.9.0.112952407665.issue25402@psf.upfronthosting.co.za>
2015-10-14 11:42:43serhiy.storchakalinkissue25402 messages
2015-10-14 11:42:43serhiy.storchakacreate