pub struct Modulo<'a>(_);
Modular arithmetic.
let ring = ModuloRing::new(&ubig!(10000));
let x = ring.from(12345);
let y = ring.from(55443);
assert_eq!((x - y).residue(), ubig!(6902));
Get the residue in range 0..n
in an n-element ring.
let ring = ModuloRing::new(&ubig!(100));
let x = ring.from(-1234);
assert_eq!(x.residue(), ubig!(66));
Exponentiation.
let p = ubig!(2).pow(607) - ubig!(1);
let ring = ModuloRing::new(&p);
let a = ring.from(123);
assert_eq!(a.pow(&(p - ubig!(1))), ring.from(1));
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
Formats the value using the given formatter.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
Formats the value using the given formatter.
Equality within a ring.
Panics if the two values are from different rings.
fn eq(&self, other: &Self) -> bool
[src]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]
pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
Formats the value using the given formatter.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
[src]
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String
. Read more
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,