Mark Dickinson <dicki...@gmail.com> added the comment: Here's a second revision of Trevor's patch:
- factor out the code for creating Montgomery representatives; this simplifies the changes to the main long_pow function - get rid of l_invmod and use a simple function for computing the negation of an inverse of a single digit modulo PyLong_BASE instead - Montgomery reduction wasn't being used for multidigit exponent b if the last digit of the exponent is small. Fix this. - add 'static' qualifier to mont_reduce function - use type Py_ssize_t instead of int for digit indices in mont_reduce - various other unimportant style fixes ---------- Added file: http://bugs.python.org/file15712/long_pow_2009_12_31.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue936813> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com