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