RosettaCodeData/Task/Exponentiation-operator/Lucid/exponentiation-operator.lucid

7 lines
117 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
pow(n,x)
k = n fby k div 2;
p = x fby p*p;
y =1 fby if even(k) then y else y*p;
result y asa k eq 0;
end