Changes for version 0.35 - 2013-12-08
- API Changes
- We now use Math::BigInt in the module rather than dynamically loading it, and will switch to BigInts as needed. The most noticeable effect of this is that next_prime() / prev_prime() will switch between BigInt and native int at the boundary without regard to the input type or whether bigint is in effect, and next_prime will never return 0. Additionally, all functions will convert large decimal number strings to BigInts if needed.
- $pref = primes("1000000000000000000000", "1000000000000000000999"); is_prime("882249208105452588824618008529"); $a = euler_phi("801294088771394680000412");
- We now use Math::BigInt in the module rather than dynamically loading it, and will switch to BigInts as needed. The most noticeable effect of this is that next_prime() / prev_prime() will switch between BigInt and native int at the boundary without regard to the input type or whether bigint is in effect, and next_prime will never return 0. Additionally, all functions will convert large decimal number strings to BigInts if needed.
- FUNCTIONALITY AND PERFORMANCE
- Switched to extended LMO algorithm for prime_count. Much better memory use and much faster for large values. Speeds up nth_prime also. Huge thanks to Christian Bau's excellent paper and examples.
- Some fixes for 32-bit.
- prime_count_approx, upper, and lower return exact answers in more cases.
- Fixed a problem with Lehmer prime_count introduced in 0.34.
- nth_prime changed from RiemannR to inverse Li (with partial addition). This makes some of the big nth_prime calculations (e.g. 10^15, 10^16) run quite a bit faster as they sieve less on average.
Modules
Utilities related to prime numbers, including fast sieves and factoring
Elliptic curve operations for affine points
Elliptic curve operations for projective points
An auto-free object for Math::Prime::Util
Pure Perl version of Math::Prime::Util
Primality proofs and certificates
A tied array for primes
An object iterator for primes
Perl Big Float versions of Riemann Zeta and R functions
Examples
- examples/README
- examples/abundant.pl
- examples/bench-factor-extra.pl
- examples/bench-factor-semiprime.pl
- examples/bench-factor.pl
- examples/bench-is-prime.pl
- examples/bench-isprime-bpsw.pl
- examples/bench-miller-rabin.pl
- examples/bench-mp-nextprime.pl
- examples/bench-mp-prime_count.pl
- examples/bench-mp-psrp.pl
- examples/bench-nthprime.pl
- examples/bench-pcapprox.pl
- examples/bench-pp-count.pl
- examples/bench-pp-isprime.pl
- examples/bench-pp-sieve.pl
- examples/bench-primearray.pl
- examples/bench-primecount.pl
- examples/bench-random-prime-bigint.pl
- examples/bench-random-prime.pl
- examples/find_mr_bases.pl
- examples/parallel_fibprime.pl
- examples/sophie_germain.pl
- examples/test-factor-gnufactor.pl
- examples/test-factor-yafu.pl
- examples/test-nextprime-yafu.pl
- examples/test-primes-yafu.pl
- examples/twin_primes.pl
- examples/verify-cert.pl
- examples/verify-gmp-ecpp-cert.pl
- examples/verify-sage-ecpp-cert.pl