[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Factorial Elegance



In article <20000915050511.H5559@athens.aocn.com>,
Michael G Schwern <schwern@pobox.com> wrote:
> Oh, much too much code.
> 
> use Tie::Math qw(f X);
> tie %factorial, 'Tie::Math', sub { f(X) = X * f(X-1) },
>                              sub { f(0) = 0;  f(1) = 1; };
> print $factorial{10}, "\n";

Oh, much too much code.

use Math::Pari 'ifact';
print ifact(10), "\n";

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe