Anonymous user
Modular inverse: Difference between revisions
add builtin function "pow" to python
m (→Using Extended Euclidean Algorithm: tweaked layout) |
imported>Koen (add builtin function "pow" to python) |
||
Line 2,801:
=={{header|Python}}==
===Builtin function===
Since python3.8, builtin function "pow" can be used directly to compute modular inverses by specifying an exponent of -1:
<syntaxhighlight lang="python">>>> pow(42, -1, 2017)
1969
</syntaxhighlight>
===Iteration and error-handling===
|