Math::Big::Factors - factor big numbers into prime factors using different algorithmns
use Math::Big::Factors; $wheel = wheel (4); # prime number wheel of 2,3,5,7 print $wheel->[0],$wheel->[1],$wheel->[2],$wheel->[3],"\n"; @factors = factors_wheel(19*71*59*3,1); # using prime wheel of order 1 @factors = factors_wheel(19*71*59*3,7); # using prime wheel of order 7
perl5.005, Exporter, Math::BigInt, Math::BigFloat, Math::Big
Exports nothing on default, but can export wheel(), factor(), factors_wheel();
wheel()
factor()
factors_wheel()
This module contains some routines that may come in handy when you want to factor big numbers into prime factors. examples.
$wheel = wheel($o);
Returns a reference to a prime wheel of order $o. This is used for factoring numbers into prime factors.
A wheel of order 7 saves about 50% of all trial divisions over the normal trial division factor algorihmn. Higher oder will save less and less, but a wheel of size 8 takes so long to compute and much memory that it is not worth the effort, limiting wheels of practicable size to order 7. For very small numbers the computation of the wheel of order 7 may actually take longer than the factorization, but anything that has more than 10 digits will usually benefit from order 7.
Factor a number into its prime factors and return a list of factors.
Please report any bugs or feature requests to bug-math-big at rt.cpan.org, or through the web interface at https://rt.cpan.org/Ticket/Create.html?Queue=Math-Big (requires login). We will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-math-big at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Math::Big
You can also look for information at:
GitHub
https://github.com/pjacklam/p5-Math-Big
RT: CPAN's request tracker
https://rt.cpan.org/Dist/Display.html?Name=Math-Big
MetaCPAN
https://metacpan.org/release/Math-Big
CPAN Testers Matrix
http://matrix.cpantesters.org/?dist=Math-Big
CPAN Ratings
https://cpanratings.perl.org/dist/Math-Big
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
Tels http://bloodgate.com 2001-2007.
Peter John Acklam <pjacklam@gmail.com> 2016-.
To install Math::Big, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Big
CPAN shell
perl -MCPAN -e shell install Math::Big
For more information on module installation, please visit the detailed CPAN module installation guide.