RosettaCodeData/Task/Exponentiation-operator/Logo/exponentiation-operator.logo

6 lines
139 B
Plaintext

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