4 ms·
modpow() defined in the article is already provided by the built-in pow() which takes a modulus as its third argument. https://docs.python.org/3/library/functio
by rgovostes 3y ago
modpow() defined in the article is already provided by the built-in pow() which takes a modulus as its third argument. https://docs.python.org/3/library/functions.html#pow https://docs.python.org/3/library/functions.html#pow
- Retr0id 3y agoSimilarly, you can compute the modular multiplicative inverse by passing -1 as the second argument to pow()