Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Factorial algorithm execution time

by blakem (Monsignor)
on Oct 17, 2002 at 19:57 UTC ( #206115=note: print w/ replies, xml ) Need Help??


in reply to Factorial algorithm execution time

Perhaps some trivial unit tests would be helpful.....

die "fact is broken" unless fact(5) == 120; die "fact2 is broken" unless fact2(5,1) == 120; die "fact3 is broken" unless fact3(5) == 120;
Update: added second arg to fact2. (thanks YuckFoo)

-Blake


Comment on Re: Factorial algorithm execution time
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2015-07-06 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls