pub struct DefaultStatic<T, M: Get<T = T>>(_);Expand description
why default?
because there exists other modular arithmetic implementations.
e.g. Montgomery Multiplication, or Burrett Reduction.
Trait Implementations§
source§impl<T: Clone, M: Clone + Get<T = T>> Clone for DefaultStatic<T, M>
impl<T: Clone, M: Clone + Get<T = T>> Clone for DefaultStatic<T, M>
source§fn clone(&self) -> DefaultStatic<T, M>
fn clone(&self) -> DefaultStatic<T, M>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<T: Default, M: Default + Get<T = T>> Default for DefaultStatic<T, M>
impl<T: Default, M: Default + Get<T = T>> Default for DefaultStatic<T, M>
source§fn default() -> DefaultStatic<T, M>
fn default() -> DefaultStatic<T, M>
Returns the “default value” for a type. Read more
source§impl<M: Get<T = u32>> ModularArithmetic for DefaultStatic<u32, M>
impl<M: Get<T = u32>> ModularArithmetic for DefaultStatic<u32, M>
type T = u32
fn modulus() -> Self::T
fn add(lhs: Self::T, rhs: Self::T) -> Self::T
fn neg(x: Self::T) -> Self::T
fn mul(lhs: Self::T, rhs: Self::T) -> Self::T
fn inv(x: u32) -> Self::T
fn sub(lhs: Self::T, rhs: Self::T) -> Self::T
fn div(lhs: Self::T, rhs: Self::T) -> Self::T
source§impl<M: Get<T = u64>> ModularArithmetic for DefaultStatic<u64, M>
impl<M: Get<T = u64>> ModularArithmetic for DefaultStatic<u64, M>
type T = u64
fn modulus() -> Self::T
fn add(lhs: Self::T, rhs: Self::T) -> Self::T
fn neg(x: Self::T) -> Self::T
fn mul(lhs: Self::T, rhs: Self::T) -> Self::T
fn inv(x: u64) -> Self::T
fn sub(lhs: Self::T, rhs: Self::T) -> Self::T
fn div(lhs: Self::T, rhs: Self::T) -> Self::T
source§impl<T: Ord, M: Ord + Get<T = T>> Ord for DefaultStatic<T, M>
impl<T: Ord, M: Ord + Get<T = T>> Ord for DefaultStatic<T, M>
source§fn cmp(&self, other: &DefaultStatic<T, M>) -> Ordering
fn cmp(&self, other: &DefaultStatic<T, M>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T: PartialEq, M: PartialEq + Get<T = T>> PartialEq<DefaultStatic<T, M>> for DefaultStatic<T, M>
impl<T: PartialEq, M: PartialEq + Get<T = T>> PartialEq<DefaultStatic<T, M>> for DefaultStatic<T, M>
source§fn eq(&self, other: &DefaultStatic<T, M>) -> bool
fn eq(&self, other: &DefaultStatic<T, M>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<T: PartialOrd, M: PartialOrd + Get<T = T>> PartialOrd<DefaultStatic<T, M>> for DefaultStatic<T, M>
impl<T: PartialOrd, M: PartialOrd + Get<T = T>> PartialOrd<DefaultStatic<T, M>> for DefaultStatic<T, M>
source§fn partial_cmp(&self, other: &DefaultStatic<T, M>) -> Option<Ordering>
fn partial_cmp(&self, other: &DefaultStatic<T, M>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more