pub trait ModNumeric {
// Required methods
fn sub_mod(self, rhs: Self, n: Self) -> Self;
fn add_mod(self, rhs: Self, n: Self) -> Self;
fn mul_mod(self, rhs: Self, n: Self) -> Self;
fn pow_mod(self, exp: Self, n: Self) -> Self;
fn modulo(self, n: Self) -> Self;
fn signed_modulo(self, n: Self) -> Self;
fn absolute(self) -> Self;
}
Required Methods§
Sourcefn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl ModNumeric for i8
impl ModNumeric for i8
Source§fn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer
Source§impl ModNumeric for i16
impl ModNumeric for i16
Source§fn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer
Source§impl ModNumeric for i32
impl ModNumeric for i32
Source§fn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer
Source§impl ModNumeric for i64
impl ModNumeric for i64
Source§fn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer
Source§impl ModNumeric for i128
impl ModNumeric for i128
Source§fn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer
Source§impl ModNumeric for u8
impl ModNumeric for u8
Source§fn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer
Source§impl ModNumeric for u16
impl ModNumeric for u16
Source§fn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer
Source§impl ModNumeric for u32
impl ModNumeric for u32
Source§fn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer
Source§impl ModNumeric for u64
impl ModNumeric for u64
Source§fn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer
Source§impl ModNumeric for u128
impl ModNumeric for u128
Source§fn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer