RosettaCodeData/Task/Exponentiation-operator/Forth/exponentiation-operator-2.fth
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

8 lines
139 B
Forth

: 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 ;