]> granicus.if.org Git - python/commit
PyLong_FromString(): Continued fraction analysis (explained in
authorTim Peters <tim.peters@gmail.com>
Tue, 30 May 2006 15:53:34 +0000 (15:53 +0000)
committerTim Peters <tim.peters@gmail.com>
Tue, 30 May 2006 15:53:34 +0000 (15:53 +0000)
commit9faa3eda6b767ddfae8ff2627d50edd6ad072490
tree720cda8292308ce32c755e64038417d2fb22b958
parent69fe4055a3124f77f6f13cea549ede3bfacca8b5
PyLong_FromString():  Continued fraction analysis (explained in
a new comment) suggests there are almost certainly large input
integers in all non-binary input bases for which one Python digit
too few is initally allocated to hold the final result.  Instead
of assert-failing when that happens, allocate more space.  Alas,
I estimate it would take a few days to find a specific such case,
so this isn't backed up by a new test (not to mention that such
a case may take hours to run, since conversion time is quadratic
in the number of digits, and preliminary attempts suggested that
the smallest such inputs contain at least a million digits).
Objects/longobject.c