The problem is that your are trying to use the exlusive-or operator ^ to perform exponentiation **.
This works:
use Math::Trig; use bignum; sub factorial { my $n = @_; my $root = sqrt($n*2*pi); my $exp = ($n/exp(1)) ** $n; my $result =$root*$exp; return $result; } my $b = 2032597; my $r = Math::BigInt->new(factorial($b)); print "b is $b\n"; print "the calculated result is $r\n";
In reply to Re: Operations with Extremely Large Numbers
by BrowserUk
in thread Operations with Extremely Large Numbers
by jjw017
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |