Trait num_modular::ModularInteger
source · [−]pub trait ModularInteger: Sized + PartialEq + Add<Self, Output = Self> + Sub<Self, Output = Self> + Neg<Output = Self> + Mul<Self, Output = Self> {
type Base;
fn modulus(&self) -> &Self::Base;
fn residue(&self) -> Self::Base;
fn convert(&self, n: Self::Base) -> Self;
}
Expand description
Represents an number defined in a modulo ring ℤ/nℤ
The operators should panic if the modulus of two number are not the same.