[−][src]Struct modular::Modulo
Holds the modulo representation of a number
In mathematics, the %
operation returns the remainder obtained when an integer a
is divided
by another n
. For instance 32 % 6 = 2
: in this example, 32 can be written in terms of its
reminder after being divided by the specified dividend as 2 mod 6
. This is the modulo
representation of the number 32, with modulus 6.
Methods
impl Modulo
[src]
pub fn remainder(self) -> i32
[src]
Returns the 'remainder' part of a modulo number
pub fn modulus(self) -> u32
[src]
Returns the modulus of a modulo number
This is sometimes referred to as the 'dividend' as well
Trait Implementations
impl Clone for Modulo
[src]
fn clone(&self) -> Modulo
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Modulo
[src]
impl PartialEq<Modulo> for Modulo
[src]
impl Add<Modulo> for Modulo
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
impl Sub<Modulo> for Modulo
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self
[src]
impl Mul<Modulo> for Modulo
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self
[src]
impl Debug for Modulo
[src]
impl Display for Modulo
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,