Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/Modular-inverse/EasyLang/modular-inverse.easy
Normal file
21
Task/Modular-inverse/EasyLang/modular-inverse.easy
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
proc mod_inv a b . x1 .
|
||||
b0 = b
|
||||
x1 = 1
|
||||
if b = 1
|
||||
break 1
|
||||
.
|
||||
while a > 1
|
||||
q = a div b
|
||||
t = b
|
||||
b = a mod b
|
||||
a = t
|
||||
t = x0
|
||||
x0 = x1 - q * x0
|
||||
x1 = t
|
||||
.
|
||||
if x1 < 0
|
||||
x1 += b0
|
||||
.
|
||||
.
|
||||
call mod_inv 42 2017 r
|
||||
print r
|
||||
Loading…
Add table
Add a link
Reference in a new issue