Trait malachite_base::num::arithmetic::traits::ModShr
source · [−]pub trait ModShr<RHS, M = Self> {
type Output;
fn mod_shr(self, other: RHS, m: M) -> Self::Output;
}
Expand description
Left-shifts a number (divides it by a power of 2) modulo another number $m$. Assumes the input is already reduced modulo $m$.
Required Associated Types
Required Methods
Implementations on Foreign Types
sourceimpl ModShr<i8, u8> for u8
impl ModShr<i8, u8> for u8
sourcefn mod_shr(self, other: i8, m: u8) -> u8
fn mod_shr(self, other: i8, m: u8) -> u8
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u8
sourceimpl ModShr<i16, u8> for u8
impl ModShr<i16, u8> for u8
sourcefn mod_shr(self, other: i16, m: u8) -> u8
fn mod_shr(self, other: i16, m: u8) -> u8
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u8
sourceimpl ModShr<i32, u8> for u8
impl ModShr<i32, u8> for u8
sourcefn mod_shr(self, other: i32, m: u8) -> u8
fn mod_shr(self, other: i32, m: u8) -> u8
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u8
sourceimpl ModShr<i64, u8> for u8
impl ModShr<i64, u8> for u8
sourcefn mod_shr(self, other: i64, m: u8) -> u8
fn mod_shr(self, other: i64, m: u8) -> u8
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u8
sourceimpl ModShr<i128, u8> for u8
impl ModShr<i128, u8> for u8
sourcefn mod_shr(self, other: i128, m: u8) -> u8
fn mod_shr(self, other: i128, m: u8) -> u8
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u8
sourceimpl ModShr<isize, u8> for u8
impl ModShr<isize, u8> for u8
sourcefn mod_shr(self, other: isize, m: u8) -> u8
fn mod_shr(self, other: isize, m: u8) -> u8
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u8
sourceimpl ModShr<i8, u16> for u16
impl ModShr<i8, u16> for u16
sourcefn mod_shr(self, other: i8, m: u16) -> u16
fn mod_shr(self, other: i8, m: u16) -> u16
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u16
sourceimpl ModShr<i16, u16> for u16
impl ModShr<i16, u16> for u16
sourcefn mod_shr(self, other: i16, m: u16) -> u16
fn mod_shr(self, other: i16, m: u16) -> u16
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u16
sourceimpl ModShr<i32, u16> for u16
impl ModShr<i32, u16> for u16
sourcefn mod_shr(self, other: i32, m: u16) -> u16
fn mod_shr(self, other: i32, m: u16) -> u16
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u16
sourceimpl ModShr<i64, u16> for u16
impl ModShr<i64, u16> for u16
sourcefn mod_shr(self, other: i64, m: u16) -> u16
fn mod_shr(self, other: i64, m: u16) -> u16
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u16
sourceimpl ModShr<i128, u16> for u16
impl ModShr<i128, u16> for u16
sourcefn mod_shr(self, other: i128, m: u16) -> u16
fn mod_shr(self, other: i128, m: u16) -> u16
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u16
sourceimpl ModShr<isize, u16> for u16
impl ModShr<isize, u16> for u16
sourcefn mod_shr(self, other: isize, m: u16) -> u16
fn mod_shr(self, other: isize, m: u16) -> u16
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u16
sourceimpl ModShr<i8, u32> for u32
impl ModShr<i8, u32> for u32
sourcefn mod_shr(self, other: i8, m: u32) -> u32
fn mod_shr(self, other: i8, m: u32) -> u32
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u32
sourceimpl ModShr<i16, u32> for u32
impl ModShr<i16, u32> for u32
sourcefn mod_shr(self, other: i16, m: u32) -> u32
fn mod_shr(self, other: i16, m: u32) -> u32
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u32
sourceimpl ModShr<i32, u32> for u32
impl ModShr<i32, u32> for u32
sourcefn mod_shr(self, other: i32, m: u32) -> u32
fn mod_shr(self, other: i32, m: u32) -> u32
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u32
sourceimpl ModShr<i64, u32> for u32
impl ModShr<i64, u32> for u32
sourcefn mod_shr(self, other: i64, m: u32) -> u32
fn mod_shr(self, other: i64, m: u32) -> u32
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u32
sourceimpl ModShr<i128, u32> for u32
impl ModShr<i128, u32> for u32
sourcefn mod_shr(self, other: i128, m: u32) -> u32
fn mod_shr(self, other: i128, m: u32) -> u32
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u32
sourceimpl ModShr<isize, u32> for u32
impl ModShr<isize, u32> for u32
sourcefn mod_shr(self, other: isize, m: u32) -> u32
fn mod_shr(self, other: isize, m: u32) -> u32
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u32
sourceimpl ModShr<i8, u64> for u64
impl ModShr<i8, u64> for u64
sourcefn mod_shr(self, other: i8, m: u64) -> u64
fn mod_shr(self, other: i8, m: u64) -> u64
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u64
sourceimpl ModShr<i16, u64> for u64
impl ModShr<i16, u64> for u64
sourcefn mod_shr(self, other: i16, m: u64) -> u64
fn mod_shr(self, other: i16, m: u64) -> u64
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u64
sourceimpl ModShr<i32, u64> for u64
impl ModShr<i32, u64> for u64
sourcefn mod_shr(self, other: i32, m: u64) -> u64
fn mod_shr(self, other: i32, m: u64) -> u64
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u64
sourceimpl ModShr<i64, u64> for u64
impl ModShr<i64, u64> for u64
sourcefn mod_shr(self, other: i64, m: u64) -> u64
fn mod_shr(self, other: i64, m: u64) -> u64
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u64
sourceimpl ModShr<i128, u64> for u64
impl ModShr<i128, u64> for u64
sourcefn mod_shr(self, other: i128, m: u64) -> u64
fn mod_shr(self, other: i128, m: u64) -> u64
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u64
sourceimpl ModShr<isize, u64> for u64
impl ModShr<isize, u64> for u64
sourcefn mod_shr(self, other: isize, m: u64) -> u64
fn mod_shr(self, other: isize, m: u64) -> u64
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u64
sourceimpl ModShr<i8, u128> for u128
impl ModShr<i8, u128> for u128
sourcefn mod_shr(self, other: i8, m: u128) -> u128
fn mod_shr(self, other: i8, m: u128) -> u128
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u128
sourceimpl ModShr<i16, u128> for u128
impl ModShr<i16, u128> for u128
sourcefn mod_shr(self, other: i16, m: u128) -> u128
fn mod_shr(self, other: i16, m: u128) -> u128
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u128
sourceimpl ModShr<i32, u128> for u128
impl ModShr<i32, u128> for u128
sourcefn mod_shr(self, other: i32, m: u128) -> u128
fn mod_shr(self, other: i32, m: u128) -> u128
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u128
sourceimpl ModShr<i64, u128> for u128
impl ModShr<i64, u128> for u128
sourcefn mod_shr(self, other: i64, m: u128) -> u128
fn mod_shr(self, other: i64, m: u128) -> u128
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u128
sourceimpl ModShr<i128, u128> for u128
impl ModShr<i128, u128> for u128
sourcefn mod_shr(self, other: i128, m: u128) -> u128
fn mod_shr(self, other: i128, m: u128) -> u128
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u128
sourceimpl ModShr<isize, u128> for u128
impl ModShr<isize, u128> for u128
sourcefn mod_shr(self, other: isize, m: u128) -> u128
fn mod_shr(self, other: isize, m: u128) -> u128
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = u128
sourceimpl ModShr<i8, usize> for usize
impl ModShr<i8, usize> for usize
sourcefn mod_shr(self, other: i8, m: usize) -> usize
fn mod_shr(self, other: i8, m: usize) -> usize
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = usize
sourceimpl ModShr<i16, usize> for usize
impl ModShr<i16, usize> for usize
sourcefn mod_shr(self, other: i16, m: usize) -> usize
fn mod_shr(self, other: i16, m: usize) -> usize
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = usize
sourceimpl ModShr<i32, usize> for usize
impl ModShr<i32, usize> for usize
sourcefn mod_shr(self, other: i32, m: usize) -> usize
fn mod_shr(self, other: i32, m: usize) -> usize
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = usize
sourceimpl ModShr<i64, usize> for usize
impl ModShr<i64, usize> for usize
sourcefn mod_shr(self, other: i64, m: usize) -> usize
fn mod_shr(self, other: i64, m: usize) -> usize
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = usize
sourceimpl ModShr<i128, usize> for usize
impl ModShr<i128, usize> for usize
sourcefn mod_shr(self, other: i128, m: usize) -> usize
fn mod_shr(self, other: i128, m: usize) -> usize
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.
type Output = usize
sourceimpl ModShr<isize, usize> for usize
impl ModShr<isize, usize> for usize
sourcefn mod_shr(self, other: isize, m: usize) -> usize
fn mod_shr(self, other: isize, m: usize) -> usize
Right-shifts a number (divides it by a power of 2) modulo a number $m$. Assumes the input is already reduced modulo $m$.
$f(x, n, m) = y$, where $x, y < m$ and $\lfloor 2^{-n}x \rfloor \equiv y \mod m$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is
other.significant_bits()
.
Examples
See here.