pub trait Primality {
// Required methods
fn is_probably_prime(&self, witnesses: u32) -> bool;
fn next_prime(&self) -> Self;
}Expand description
Primality testing operations.
Required Methods§
Sourcefn is_probably_prime(&self, witnesses: u32) -> bool
fn is_probably_prime(&self, witnesses: u32) -> bool
Returns true if the number is (probably) prime.
Uses Miller-Rabin with the given number of witnesses.
With witnesses = 0, uses a deterministic set for small values
and a sensible default count for large values.
Sourcefn next_prime(&self) -> Self
fn next_prime(&self) -> Self
Returns the next prime greater than self.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".