c_prime/ptrait.rs
1/// Trait for primality over all primitive types
2pub trait Primality: Clone + Copy + std::ops::AddAssign + std::ops::SubAssign + std::cmp::PartialOrd{
3 /// Unit of the Set
4 const ONE : Self;
5
6 /// Minimum prime in the set
7 const FIRST_PRIME : Self;
8
9 /// Maximum prime in the set
10 const LAST_PRIME : Self ;
11
12 /// Returns true if prime
13 fn is_prime(&self) -> bool;
14
15 /// Minimal computation for primality proving
16 fn strong_case(&self) -> bool;
17}
18