Tim Peters added the comment:

A bit of history:  last time I fiddled that code, I didn't worry about this, 
because for large enough exponents all internal numbers _eventually_ become 
less than `base`.  But the patch can speed up the _startup_ costs by an 
arbitrary amount (for smaller exponents it's _all_ "startup costs", while for 
larger exponents there are 31 multiplications by `base` to precompute a 
5-bits-a-time table).

Of course there's no problem with correctness here:  `base` and `base % 
modulus` are equivalent in this algorithm.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19171>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to