RosettaCodeData/Task/Modular-exponentiation/M2000-Interpreter/modular-exponentiation-2.m2000
2026-04-30 12:34:36 -04:00

16 lines
528 B
Text

If Version<14 then Error "Need version >=14"
Function PowerTen(x as BigInteger) {
BigInteger a=10
method a, "intPower", x as a
=a
}
Print PowerTen(40)=10000000000000000000000000000000000000000u ' true
' 1234u is BigInteger literal value.
' so here a and b get type by the first value's type
a=2988348162058574136915891421498819466320163312926952423791023078876139u
b=2351399303373464486466122544523690094744975233415544072992656881240319u
profiler
method a, "modpow", b, PowerTen(40) as result
print timecount
Print result