Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: recursive formula.

by rsteinke (Scribe)
on Aug 05, 2004 at 14:35 UTC ( [id://380263]=note: print w/replies, xml ) Need Help??


in reply to recursive formula.

Should be something like

sub 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; }
note: untested

Ron Steinke rsteinke@w-link.net

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://380263]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-03-28 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found