Trait malachite_base::num::arithmetic::traits::EqModPowerOf2

source ·
pub trait EqModPowerOf2<RHS = Self> {
    // Required method
    fn eq_mod_power_of_2(self, other: RHS, pow: u64) -> bool;
}
Expand description

Determines whether a number is equivalent to another number modulo $2^k$.

Required Methods§

source

fn eq_mod_power_of_2(self, other: RHS, pow: u64) -> bool

Implementations on Foreign Types§

source§

impl EqModPowerOf2 for i8

source§

fn eq_mod_power_of_2(self, other: i8, pow: u64) -> bool

Returns whether one number is equal to another modulo $2^k$.

$f(x, y, k) = (x \equiv y \mod 2^k)$.

$f(x, y, k) = (\exists n \in \Z : x - y = n2^k)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqModPowerOf2 for i16

source§

fn eq_mod_power_of_2(self, other: i16, pow: u64) -> bool

Returns whether one number is equal to another modulo $2^k$.

$f(x, y, k) = (x \equiv y \mod 2^k)$.

$f(x, y, k) = (\exists n \in \Z : x - y = n2^k)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqModPowerOf2 for i32

source§

fn eq_mod_power_of_2(self, other: i32, pow: u64) -> bool

Returns whether one number is equal to another modulo $2^k$.

$f(x, y, k) = (x \equiv y \mod 2^k)$.

$f(x, y, k) = (\exists n \in \Z : x - y = n2^k)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqModPowerOf2 for i64

source§

fn eq_mod_power_of_2(self, other: i64, pow: u64) -> bool

Returns whether one number is equal to another modulo $2^k$.

$f(x, y, k) = (x \equiv y \mod 2^k)$.

$f(x, y, k) = (\exists n \in \Z : x - y = n2^k)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqModPowerOf2 for i128

source§

fn eq_mod_power_of_2(self, other: i128, pow: u64) -> bool

Returns whether one number is equal to another modulo $2^k$.

$f(x, y, k) = (x \equiv y \mod 2^k)$.

$f(x, y, k) = (\exists n \in \Z : x - y = n2^k)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqModPowerOf2 for isize

source§

fn eq_mod_power_of_2(self, other: isize, pow: u64) -> bool

Returns whether one number is equal to another modulo $2^k$.

$f(x, y, k) = (x \equiv y \mod 2^k)$.

$f(x, y, k) = (\exists n \in \Z : x - y = n2^k)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqModPowerOf2 for u8

source§

fn eq_mod_power_of_2(self, other: u8, pow: u64) -> bool

Returns whether one number is equal to another modulo $2^k$.

$f(x, y, k) = (x \equiv y \mod 2^k)$.

$f(x, y, k) = (\exists n \in \Z : x - y = n2^k)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqModPowerOf2 for u16

source§

fn eq_mod_power_of_2(self, other: u16, pow: u64) -> bool

Returns whether one number is equal to another modulo $2^k$.

$f(x, y, k) = (x \equiv y \mod 2^k)$.

$f(x, y, k) = (\exists n \in \Z : x - y = n2^k)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqModPowerOf2 for u32

source§

fn eq_mod_power_of_2(self, other: u32, pow: u64) -> bool

Returns whether one number is equal to another modulo $2^k$.

$f(x, y, k) = (x \equiv y \mod 2^k)$.

$f(x, y, k) = (\exists n \in \Z : x - y = n2^k)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqModPowerOf2 for u64

source§

fn eq_mod_power_of_2(self, other: u64, pow: u64) -> bool

Returns whether one number is equal to another modulo $2^k$.

$f(x, y, k) = (x \equiv y \mod 2^k)$.

$f(x, y, k) = (\exists n \in \Z : x - y = n2^k)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqModPowerOf2 for u128

source§

fn eq_mod_power_of_2(self, other: u128, pow: u64) -> bool

Returns whether one number is equal to another modulo $2^k$.

$f(x, y, k) = (x \equiv y \mod 2^k)$.

$f(x, y, k) = (\exists n \in \Z : x - y = n2^k)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqModPowerOf2 for usize

source§

fn eq_mod_power_of_2(self, other: usize, pow: u64) -> bool

Returns whether one number is equal to another modulo $2^k$.

$f(x, y, k) = (x \equiv y \mod 2^k)$.

$f(x, y, k) = (\exists n \in \Z : x - y = n2^k)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Implementors§