I came across a problem of calculating 100 factorial.
Here is what I tried first in Perl to calculate 100! :
#!/usr/bin/perl
use strict;
use warnings;
use Math::BigInt;
my $n=<>;
chomp($n);
print fac($n);
sub fac
{
my ($m) = @_;
return 1 if($m <=1 );
return $m*fac($m-1);
}
But this is giving me 9.33262154439441e+157
.
I need the answer with all of the digits.
What do I do?