Modular inverse: Difference between revisions
Content added Content deleted
m (→{{header|Julia}}: update for v 1.2) |
|||
Line 1,276: | Line 1,276: | ||
{{trans|AWK}} |
{{trans|AWK}} |
||
<syntaxhighlight lang="easylang"> |
<syntaxhighlight lang="easylang"> |
||
func mod_inv a b . |
|||
b0 = b |
b0 = b |
||
x1 = 1 |
x1 = 1 |
||
if b = 1 |
if b = 1 |
||
return 1 |
|||
. |
. |
||
while a > 1 |
while a > 1 |
||
Line 1,294: | Line 1,294: | ||
x1 += b0 |
x1 += b0 |
||
. |
. |
||
return x1 |
|||
. |
. |
||
print mod_inv 42 2017 |
|||
print r |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||