Struct num_modular::MersenneInt
source · [−]Expand description
An unsigned integer modulo (pseudo) Mersenne primes 2^P - K
, it supports P up to 127 and K < 2^(P-1)
IMPORTANT NOTE: this class assumes that 2^P-K
is a prime. During compliation, we don’t do full check
of the primality of 2^P-K
. If it’s not a prime, then the modular division and inverse will panic.
Implementations
Trait Implementations
sourceimpl<const P: u8, const K: umax> Add<MersenneInt<P, K>> for MersenneInt<P, K>
impl<const P: u8, const K: umax> Add<MersenneInt<P, K>> for MersenneInt<P, K>
sourceimpl<const P: u8, const K: umax> Clone for MersenneInt<P, K>
impl<const P: u8, const K: umax> Clone for MersenneInt<P, K>
sourcefn clone(&self) -> MersenneInt<P, K>
fn clone(&self) -> MersenneInt<P, K>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<const P: u8, const K: umax> Div<MersenneInt<P, K>> for MersenneInt<P, K>
impl<const P: u8, const K: umax> Div<MersenneInt<P, K>> for MersenneInt<P, K>
sourceimpl<const P: u8, const K: umax> From<MersenneInt<P, K>> for umax
impl<const P: u8, const K: umax> From<MersenneInt<P, K>> for umax
sourcefn from(v: MersenneInt<P, K>) -> Self
fn from(v: MersenneInt<P, K>) -> Self
Converts to this type from the input type.
sourceimpl<const P: u8, const K: umax> Inv for MersenneInt<P, K>
impl<const P: u8, const K: umax> Inv for MersenneInt<P, K>
sourceimpl<const P: u8, const K: umax> ModularInteger for MersenneInt<P, K>
impl<const P: u8, const K: umax> ModularInteger for MersenneInt<P, K>
sourceimpl<const P: u8, const K: umax> Mul<MersenneInt<P, K>> for MersenneInt<P, K>
impl<const P: u8, const K: umax> Mul<MersenneInt<P, K>> for MersenneInt<P, K>
sourceimpl<const P: u8, const K: umax> Neg for MersenneInt<P, K>
impl<const P: u8, const K: umax> Neg for MersenneInt<P, K>
sourceimpl<const P: u8, const K: umax> PartialEq<MersenneInt<P, K>> for MersenneInt<P, K>
impl<const P: u8, const K: umax> PartialEq<MersenneInt<P, K>> for MersenneInt<P, K>
sourcefn eq(&self, other: &MersenneInt<P, K>) -> bool
fn eq(&self, other: &MersenneInt<P, K>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &MersenneInt<P, K>) -> bool
fn ne(&self, other: &MersenneInt<P, K>) -> bool
This method tests for !=
.
sourceimpl<const P: u8, const K: umax> Sub<MersenneInt<P, K>> for MersenneInt<P, K>
impl<const P: u8, const K: umax> Sub<MersenneInt<P, K>> for MersenneInt<P, K>
impl<const P: u8, const K: umax> Copy for MersenneInt<P, K>
impl<const P: u8, const K: umax> Eq for MersenneInt<P, K>
impl<const P: u8, const K: umax> StructuralEq for MersenneInt<P, K>
impl<const P: u8, const K: umax> StructuralPartialEq for MersenneInt<P, K>
Auto Trait Implementations
impl<const P: u8, const K: u128> RefUnwindSafe for MersenneInt<P, K>
impl<const P: u8, const K: u128> Send for MersenneInt<P, K>
impl<const P: u8, const K: u128> Sync for MersenneInt<P, K>
impl<const P: u8, const K: u128> Unpin for MersenneInt<P, K>
impl<const P: u8, const K: u128> UnwindSafe for MersenneInt<P, K>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more