Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
19
Task/Modular-exponentiation/SETL/modular-exponentiation.setl
Normal file
19
Task/Modular-exponentiation/SETL/modular-exponentiation.setl
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
program ModPow;
|
||||
a := 2988348162058574136915891421498819466320163312926952423791023078876139;
|
||||
b := 2351399303373464486466122544523690094744975233415544072992656881240319;
|
||||
print(modpow(a, b, 10**40));
|
||||
|
||||
proc modpow(b, e, m);
|
||||
r := 1;
|
||||
loop
|
||||
init r := 1;
|
||||
step e div:= 2;
|
||||
until e = 0 do
|
||||
if e mod 2 = 1 then
|
||||
r := (b * r) mod m;
|
||||
end if;
|
||||
b := (b * b) mod m;
|
||||
end;
|
||||
return r;
|
||||
end proc;
|
||||
end program;
|
||||
Loading…
Add table
Add a link
Reference in a new issue