Math::Primality - Various Primality Algorithms
Version 0.01
use Math::Primality; use Math::BigInt; my $t1 = is_pseudoprime($x,$base); my $t2 = is_strong_pseudoprime($x);
Returns true if $n is a base $b pseudoprime, otherwise false. The variable $n should be a Math::BigInt::GMP object or a string if it is larger than long integer, which varies from system to system.
The default base of 2 is used if no base is given. Base 2 pseudoprimes are often called Fermat pseudoprimes.
if ( is_pseudoprime($n,$b) ) { ... } else { ... }
Returns true if $n is a base $b strong pseudoprime, false otherwise. The variable $n should be a Math::BigInt::GMP object or a string if it is larger than long integer. Strong psuedoprimes are often called Miller-Rabin pseudoprimes.
Jonathan Leto, <jonathan at leto.net>
<jonathan at leto.net>
Please report any bugs or feature requests to bug-math-primality at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Math::Primality. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-math-primality at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Math::Primality
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Math::Primality
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Math::Primality
CPAN Ratings
http://cpanratings.perl.org/d/Math::Primality
Search CPAN
http://search.cpan.org/dist/Math::Primality
Copyright 2009 Jonathan Leto, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Math::Primality, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Primality
CPAN shell
perl -MCPAN -e shell install Math::Primality
For more information on module installation, please visit the detailed CPAN module installation guide.