Trait malachite_base::num::arithmetic::traits::EqModPowerOf2
source · [−]pub trait EqModPowerOf2<RHS = Self> {
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
fn eq_mod_power_of_2(self, other: RHS, pow: u64) -> bool
Implementations on Foreign Types
sourceimpl EqModPowerOf2<u8> for u8
impl EqModPowerOf2<u8> for u8
sourcefn eq_mod_power_of_2(self, other: u8, pow: u64) -> bool
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.
sourceimpl EqModPowerOf2<u16> for u16
impl EqModPowerOf2<u16> for u16
sourcefn eq_mod_power_of_2(self, other: u16, pow: u64) -> bool
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.
sourceimpl EqModPowerOf2<u32> for u32
impl EqModPowerOf2<u32> for u32
sourcefn eq_mod_power_of_2(self, other: u32, pow: u64) -> bool
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.
sourceimpl EqModPowerOf2<u64> for u64
impl EqModPowerOf2<u64> for u64
sourcefn eq_mod_power_of_2(self, other: u64, pow: u64) -> bool
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.
sourceimpl EqModPowerOf2<u128> for u128
impl EqModPowerOf2<u128> for u128
sourcefn eq_mod_power_of_2(self, other: u128, pow: u64) -> bool
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.
sourceimpl EqModPowerOf2<usize> for usize
impl EqModPowerOf2<usize> for usize
sourcefn eq_mod_power_of_2(self, other: usize, pow: u64) -> bool
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.
sourceimpl EqModPowerOf2<i8> for i8
impl EqModPowerOf2<i8> for i8
sourcefn eq_mod_power_of_2(self, other: i8, pow: u64) -> bool
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.
sourceimpl EqModPowerOf2<i16> for i16
impl EqModPowerOf2<i16> for i16
sourcefn eq_mod_power_of_2(self, other: i16, pow: u64) -> bool
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.
sourceimpl EqModPowerOf2<i32> for i32
impl EqModPowerOf2<i32> for i32
sourcefn eq_mod_power_of_2(self, other: i32, pow: u64) -> bool
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.
sourceimpl EqModPowerOf2<i64> for i64
impl EqModPowerOf2<i64> for i64
sourcefn eq_mod_power_of_2(self, other: i64, pow: u64) -> bool
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.
sourceimpl EqModPowerOf2<i128> for i128
impl EqModPowerOf2<i128> for i128
sourcefn eq_mod_power_of_2(self, other: i128, pow: u64) -> bool
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.
sourceimpl EqModPowerOf2<isize> for isize
impl EqModPowerOf2<isize> for isize
sourcefn eq_mod_power_of_2(self, other: isize, pow: u64) -> bool
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.