Trait num_modular::ModularUnaryOps
source · pub trait ModularUnaryOps<Modulus = Self> {
type Output;
// Required methods
fn negm(self, m: Modulus) -> Self::Output;
fn invm(self, m: Modulus) -> Option<Self::Output>;
fn dblm(self, m: Modulus) -> Self::Output;
fn sqm(self, m: Modulus) -> Self::Output;
}
Expand description
Core unary modular arithmetics
Note that all functions will panic if the modulus is zero.
Required Associated Types§
Required Methods§
sourcefn negm(self, m: Modulus) -> Self::Output
fn negm(self, m: Modulus) -> Self::Output
Return (-self) % m and make sure the result is normalized in range [0,m)