Should be something like
note: untestedsub p { my @args = @_; # for clarity, more efficient not to copy # initializing this handles the zero argument case my $result = 0; $result += ($args[$_] - ($_ ? $args[$_-1] : 0)) * p(@args[0..($_-1)],@args[($_+1)..(@args-1)]) foreach(0..(@args-1)); return $result; }
In reply to Re: recursive formula.
by rsteinke
in thread recursive formula.
by BioGeek
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |