RosettaCodeData/Task/Exponentiation-operator/Retro/exponentiation-operator-3.retro
2023-07-01 13:44:08 -04:00

7 lines
128 B
Text

: pow ( n m -- n^m )
1 2rot
[ dup 1 and 0 <>
[ [ tuck * swap ] dip ] ifTrue
[ dup * ] dip 1 >> dup 0 <>
] while
drop drop ;