Math :: Counting looks a little silly (I mean student and engineering modes?). The real factor function provided by the module, bfact
is a thin wrapper around Math::BigInt::bfac
. So just use Math :: BigInt .
#!/usr/bin/env perl use strict; use warnings; use Math::BigInt(); print Math::BigInt->bfac('300'), "\n";
Conclusion:
30605751221644063603537046129726862938858880417357699941677674125947653317671686
74655152914224775733499391478887017263688642639077590031542268429279069745598412
25476930271954604008012215776252176854255965356903506788725264321896264299365204
57644883038890975394348962543605322598077652127082243763944912012867867536830571
22936819436499564604981664502277165001851765464693401122260347297240663332585835
06870150169794168850353752137554910289126407157154830282284937952636580145235233
15693648223343679925459409527682060806223281238738388081704960000000000000000000000
00000000000000000000000000000000000000000000000000000000000
No, I did not confirm the result .
As others have noted, Math::Counting
has:
our @ISA = qw(Exporter); our @EXPORT = qw( factorial permutation combination bfact bperm bcomb );
but no require
exporter .
In fact, there is no need for this module to inherit from Exporter. Plain:
use Exporter 'import';
would be enough. In addition, by default, it is not necessary to pollute the user namespace of this module, so it should have:
our @EXPORT = (); our @EXPORT_OK = qw( factorial permutation combination bfact bperm bcomb );
Otherwise, what is the %EXPORT_TAGS
definition point?
source share