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 tim.peters
Recipients
Date 2005-11-01.00:55:20
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=31435

This looks pretty good to me -- talk about every trick in the 
book <wink>.

Note that the digitlimit vector is too cautious for bases that 
are powers of 2.  For example, it's obvious that any string of 
32 bits can't overflow an unsigned long, but the table cuts 
base 2 off at 31 instead.  The formula should use log(2**32, 
base) instead:

"N digits can't overflow" iff
base**N-1 < 2**32  iff
base**N < 2**32+1
base**N <= 2**32  iff
N <= log(2**32, base)

Assuming exact calculation of log(2**32, base) then 
(dubious, really), the floor of that is exactly the maximum 
safe N.

The power-of-2 bases, and base 10, should be added to the 
tests.  We really want to check that _all_ supported bases 
work, right?
History
Date User Action Args
2007-08-23 15:44:18adminlinkissue1335972 messages
2007-08-23 15:44:18admincreate