Module primality

Module primality 

Source
Expand description

Primality testing and factor verification using Malachite.

Provides deterministic and probabilistic primality testing for native unsigned integers and arbitrary-precision Natural numbers.

Constants§

MILLER_RABIN_BASES
Deterministic prime testing bases for Miller-Rabin testing up to $2^{64}$.
SMALL_PRIMES
First 25 small prime numbers used for rapid trial division pre-filtering.

Functions§

is_prime_natural
Checks if an arbitrary-precision Natural number is prime using trial division followed by Miller-Rabin probabilistic primality testing.
is_prime_u64
Checks if a 64-bit integer is prime using Malachite’s BPSW algorithm.