my $SHARES = 1000; my $DIVIDEND = 0.0678; my $YEARS = 20; sub stock { my ($shares, $years) = @_; $years >= 1 ? stock(int($shares * (1 + $DIVIDEND)), $years - 1) : +$shares; } print stock $SHARES, $YEARS;
In reply to Re: dividend with recursive routine
by JavaFan
in thread dividend with recursive routine
by derpp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |