NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Fast primality testing with Pari (Score:1)
If you're after a fast way of checking for prime numbers from Perl, then it's hard to go past PARI/GP [u-bordeaux.fr], which has a Math::Pari [cpan.org] interface. With the generation of large primes, strong random numbers, support for integers up to (2^29)^29 out of the box, and a host of other math functions, Pari is essentially crack for number theorists. It provides both isprime() [u-bordeaux.fr] and ispseudoprime() [wikipedia.org] functions.
There's also a brief mention of using Math::Pari for primality testing on perlmonks [perlmonks.org].
Cheerio,
Paul
Reply to This