RosettaCodeData/Task/Exponentiation-operator/Logo/exponentiation-operator.logo
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

5 lines
139 B
Text

to int_power :n :m
if equal? 0 :m [output 1]
if equal? 0 modulo :m 2 [output int_power :n*:n :m/2]
output :n * int_power :n :m-1
end