$powerof(N,I) Calculates N to the Power of I, can list also.
; $powerof(N,I) <-- Usage: Calculates N to the power of I
; Other use: $powerof(N,I).all <-- Calculates N to the power of I, but lists N to the power of all numbers up to I
; Example I: $powerof(12,4).all <-- Returns 144 1728 20736
; Example II: $powerof(10,6) <-- Returns 1000000
Specify any prop (.<>) for it to list.
; $powerof(N,I) <-- Usage: Calculates N to the power of I
; Other use: $powerof(N,I).all <-- Calculates N to the power of I, but lists N to the power of all numbers up to I
; Example I: $powerof(12,4).all <-- Returns 144 1728 20736
; Example II: $powerof(10,6) <-- Returns 1000000
alias powerof {
if ($isid) {
var %x 1 | var %t $1 | set %y
while (%x < $2) {
inc %x
var %t $calc(%t * $1)
$iif($prop,set %y %y %t,)
}
if ($prop) { var %t %y | unset %y }
return %t
}
}