P is for Practical | |
PerlMonks |
Re^2: Triangle Numbers Revisitedby Limbic~Region (Chancellor) |
on Oct 14, 2004 at 11:29 UTC ( [id://399166]=note: print w/replies, xml ) | Need Help?? |
TedPride,
This is blazingly fast... I wanted to see just how fast, so I modified your code to fit into the benchmark FoxtrotUniform and I were playing with. It turns out your code is only about half as fast as my second version and it has a bug I didn't bother to track down. To see the bug, try entering 3133756 with your code. I say your code is only about half as fast because it got less than halfway through (line 2235 of 5000) when it blew up and it took approximately the same amount of time (3.619 seconds) to get there. In case you want to run some more tests yourself, take a look at gen_targets.pl and then use this modified code:
Cheers - L~R
In Section
Seekers of Perl Wisdom
|
|