Jump to content

Modular inverse: Difference between revisions

add builtin function "pow" to python
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===
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.