i would suggest the use of this one as a power script
REASONS:
this one i made is iterative and not recursive so it's MUCH more efficient on the memory use and on the stack, plus it uses the new AC operators and it's code is shorter and it doesnt need two functions just one.
[SELECT ALL] Code:
//made by Kirin (iterative pow algorithm, exponents are forced into integers)
alias pow [
alias pow_exp $arg2
alias pow_base $arg1
if (= $pow_exp 0) [result 1] [
if (< $pow_exp 0) [*= pow_exp -1] []
-= pow_exp 1
loop i $pow_exp [*=f pow_base $arg1]
if (> $arg2 0) [result $pow_base] [result (divf 1 $pow_base)]
]
]
this one i made is iterative and not recursive so it's MUCH more efficient on the memory use and on the stack, plus it uses the new AC operators and it's code is shorter and it doesnt need two functions just one.