pub trait Primes {
    fn next_prime(&self) -> Self;
    fn is_probable_prime(&self, n: u32) -> bool;
}
Expand description

Utilities for searching / testing prime numbers

Required Methods§

Finds next prime number using probabilistic algorithms

Probabilistically determine whether number is prime

If number is prime, is_probable_prime always returns true. If number is composite, is_probable_prime probably return false. The probability of returning true for a randomly chosen non-prime is at most 4^(-reps).

Implementors§