libmath-prime-util-perl

Utilities related to prime numbers, including fast sieves and factoring
  https://metacpan.org/release/Math-Prime-Util
  0
  no reviews



Math::prime::util is a set of perl utilities related to prime numbers. these include multiple sieving methods, is_prime, prime_count, nth_prime, approximations and bounds for the prime_count and nth prime, next_prime and prev_prime, factoring utilities, and more.

the default sieving and factoring are intended to be (and currently are) the fastest on cpan, including math::prime::xs, math::prime::fastsieve, math::factor::xs, math::prime::tiedarray, math::big::factors, math::factoring, and math::primality (when the gmp module is available). for numbers in the 10-20 digit range, it is often orders of magnitude faster. typically it is faster than math::pari for 64-bit operations.

all operations support both perl uv's (32-bit or 64-bit) and bignums. it requires no external software for big number support, as there are perl implementations included that solely use math::bigint and math::bigfloat. however, performance will be improved for most big number functions by installing math::prime::util::gmp, and is definitely recommended if you do many bignum operations. also look into math::pari as an alternative.