in reply to Operations with Extremely Large Numbers
sub factorial { my $n = @_;
This forces the @_ array to be evaluated in a scalar context. An array evaluated in a scalar context produces the length of the array. Useful - but not what you want in this case!
Change it to: Change to:
my $exp = ($n/exp(1))**$n;
Actually there may be a third problem. I kicked this off before writing this response. My (admittedly lame) PC has been maxed out since.
|
---|