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

7 lines
117 B
Text
Raw Permalink Normal View History

2013-04-10 21:29:02 -07: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