RosettaCodeData/Task/Exponentiation-operator/Forth/exponentiation-operator-2.fth

9 lines
139 B
Forth
Raw Permalink Normal View History

2013-04-10 16:57:12 -07:00
: f**n ( f n -- f^n )
dup 0= if
drop fdrop 1e
else dup 1 and if
1- fdup recurse f*
else
2/ fdup f* recurse
then then ;