You need to do this, though, "infinite" times, reason why I provided a parameter to "stop" after a certain time.sub x_power_n { my $x = shift; my $n = shift; my $result = $x; my $i = 1; while ($i < $n) { $result *= $x; $i++; } return $result; }
In reply to Re^3: Exponential Function Programming
by okram
in thread Exponential Function Programming
by Abulil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |