Trait malachite_base::num::arithmetic::traits::ModShrAssign

source ·
pub trait ModShrAssign<RHS, M = Self> {
    // Required method
    fn mod_shr_assign(&mut self, other: RHS, m: M);
}
Expand description

Left-shifts a number (divides it by a power of 2) modulo another number $m$, in place. The number must be already reduced modulo $m$.

Required Methods§

source

fn mod_shr_assign(&mut self, other: RHS, m: M)

Implementations on Foreign Types§

source§

impl ModShrAssign<i8> for u8

source§

fn mod_shr_assign(&mut self, other: i8, m: u8)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i8> for u16

source§

fn mod_shr_assign(&mut self, other: i8, m: u16)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i8> for u32

source§

fn mod_shr_assign(&mut self, other: i8, m: u32)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i8> for u64

source§

fn mod_shr_assign(&mut self, other: i8, m: u64)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i8> for u128

source§

fn mod_shr_assign(&mut self, other: i8, m: u128)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i8> for usize

source§

fn mod_shr_assign(&mut self, other: i8, m: usize)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i16> for u8

source§

fn mod_shr_assign(&mut self, other: i16, m: u8)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i16> for u16

source§

fn mod_shr_assign(&mut self, other: i16, m: u16)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i16> for u32

source§

fn mod_shr_assign(&mut self, other: i16, m: u32)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i16> for u64

source§

fn mod_shr_assign(&mut self, other: i16, m: u64)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i16> for u128

source§

fn mod_shr_assign(&mut self, other: i16, m: u128)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i16> for usize

source§

fn mod_shr_assign(&mut self, other: i16, m: usize)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i32> for u8

source§

fn mod_shr_assign(&mut self, other: i32, m: u8)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i32> for u16

source§

fn mod_shr_assign(&mut self, other: i32, m: u16)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i32> for u32

source§

fn mod_shr_assign(&mut self, other: i32, m: u32)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i32> for u64

source§

fn mod_shr_assign(&mut self, other: i32, m: u64)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i32> for u128

source§

fn mod_shr_assign(&mut self, other: i32, m: u128)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i32> for usize

source§

fn mod_shr_assign(&mut self, other: i32, m: usize)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i64> for u8

source§

fn mod_shr_assign(&mut self, other: i64, m: u8)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i64> for u16

source§

fn mod_shr_assign(&mut self, other: i64, m: u16)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i64> for u32

source§

fn mod_shr_assign(&mut self, other: i64, m: u32)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i64> for u64

source§

fn mod_shr_assign(&mut self, other: i64, m: u64)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i64> for u128

source§

fn mod_shr_assign(&mut self, other: i64, m: u128)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i64> for usize

source§

fn mod_shr_assign(&mut self, other: i64, m: usize)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i128> for u8

source§

fn mod_shr_assign(&mut self, other: i128, m: u8)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i128> for u16

source§

fn mod_shr_assign(&mut self, other: i128, m: u16)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i128> for u32

source§

fn mod_shr_assign(&mut self, other: i128, m: u32)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i128> for u64

source§

fn mod_shr_assign(&mut self, other: i128, m: u64)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i128> for u128

source§

fn mod_shr_assign(&mut self, other: i128, m: u128)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<i128> for usize

source§

fn mod_shr_assign(&mut self, other: i128, m: usize)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<isize> for u8

source§

fn mod_shr_assign(&mut self, other: isize, m: u8)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<isize> for u16

source§

fn mod_shr_assign(&mut self, other: isize, m: u16)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<isize> for u32

source§

fn mod_shr_assign(&mut self, other: isize, m: u32)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<isize> for u64

source§

fn mod_shr_assign(&mut self, other: isize, m: u64)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<isize> for u128

source§

fn mod_shr_assign(&mut self, other: isize, m: u128)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModShrAssign<isize> for usize

source§

fn mod_shr_assign(&mut self, other: isize, m: usize)

Right-shifts a number (divides it by a power of 2) modulo a number $m$, in place. The number must be already reduced modulo $m$.

$x \gets 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().

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

Implementors§