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 2001-08-31.05:23:44
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=31435

The desire is understandable but this isn't the right way 
to do it, so I'm rejecting this.  While 2.2a2 changed the 
specifics, the general rule remains that

pow(a, b, c) == a**b % c

except that the LHS may be very much faster for large 
integer arguments.

"The right way" to do modular arithmetic is to define a 
class for it, and do the full job (+ - * /, not just 
modular pow).  egcd is easy to code in Python, and because 
it's an obscure speciality need (it gets asked about maybe 
twice per year on c.l.py) doesn't really belong in the core 
even if it weren't.  I'm not even sure how 3-argument pow 
got in, but am grateful it did and don't want to press our 
luck <wink>.
History
Date User Action Args
2007-08-23 13:56:03adminlinkissue457066 messages
2007-08-23 13:56:03admincreate