Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,9 @@
|
|||
$ include "seed7_05.s7i";
|
||||
include "bigint.s7i";
|
||||
|
||||
const proc: main is func
|
||||
begin
|
||||
writeln(modPow(2988348162058574136915891421498819466320163312926952423791023078876139_,
|
||||
2351399303373464486466122544523690094744975233415544072992656881240319_,
|
||||
10_ ** 40));
|
||||
end func;
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
const func bigInteger: modPow (in var bigInteger: base,
|
||||
in var bigInteger: exponent, in bigInteger: modulus) is func
|
||||
result
|
||||
var bigInteger: power is 1_;
|
||||
begin
|
||||
if exponent < 0_ or modulus < 0_ then
|
||||
raise RANGE_ERROR;
|
||||
else
|
||||
while exponent > 0_ do
|
||||
if odd(exponent) then
|
||||
power := (power * base) mod modulus;
|
||||
end if;
|
||||
exponent >>:= 1;
|
||||
base := base ** 2 mod modulus;
|
||||
end while;
|
||||
end if;
|
||||
end func;
|
||||
Loading…
Add table
Add a link
Reference in a new issue