in reply to Re: Re: Factorial algorithm execution time
in thread Factorial algorithm execution time
Update: doh, fixed overly clever, broken code. (s{1 + $#factor / 2}{@factor / 2})sub fact7b { my @factor = map Math::BigInt->new($_), (2 .. shift); while(@factor > 1) { my @pair = splice @factor, 0, @factor / 2; $_ = $_ * pop @pair for @factor[0..$#pair]; } return shift @factor; }
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^3: Factorial algorithm execution time
by Anonymous Monk on Oct 19, 2002 at 11:20 UTC |