Trait malachite_base::num::arithmetic::traits::DivisibleByPowerOf2
source · [−]pub trait DivisibleByPowerOf2 {
fn divisible_by_power_of_2(self, pow: u64) -> bool;
}
Expand description
Determines whether a number is divisible by $2^k$.
Required Methods
fn divisible_by_power_of_2(self, pow: u64) -> bool
Implementations on Foreign Types
sourceimpl DivisibleByPowerOf2 for u8
impl DivisibleByPowerOf2 for u8
sourcefn divisible_by_power_of_2(self, pow: u64) -> bool
fn divisible_by_power_of_2(self, pow: u64) -> bool
Returns whether a number is divisible by $2^k$.
$f(x, k) = (2^k|x)$.
$f(x, k) = (\exists n \in \N : \ x = n2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleByPowerOf2 for u16
impl DivisibleByPowerOf2 for u16
sourcefn divisible_by_power_of_2(self, pow: u64) -> bool
fn divisible_by_power_of_2(self, pow: u64) -> bool
Returns whether a number is divisible by $2^k$.
$f(x, k) = (2^k|x)$.
$f(x, k) = (\exists n \in \N : \ x = n2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleByPowerOf2 for u32
impl DivisibleByPowerOf2 for u32
sourcefn divisible_by_power_of_2(self, pow: u64) -> bool
fn divisible_by_power_of_2(self, pow: u64) -> bool
Returns whether a number is divisible by $2^k$.
$f(x, k) = (2^k|x)$.
$f(x, k) = (\exists n \in \N : \ x = n2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleByPowerOf2 for u64
impl DivisibleByPowerOf2 for u64
sourcefn divisible_by_power_of_2(self, pow: u64) -> bool
fn divisible_by_power_of_2(self, pow: u64) -> bool
Returns whether a number is divisible by $2^k$.
$f(x, k) = (2^k|x)$.
$f(x, k) = (\exists n \in \N : \ x = n2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleByPowerOf2 for u128
impl DivisibleByPowerOf2 for u128
sourcefn divisible_by_power_of_2(self, pow: u64) -> bool
fn divisible_by_power_of_2(self, pow: u64) -> bool
Returns whether a number is divisible by $2^k$.
$f(x, k) = (2^k|x)$.
$f(x, k) = (\exists n \in \N : \ x = n2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleByPowerOf2 for usize
impl DivisibleByPowerOf2 for usize
sourcefn divisible_by_power_of_2(self, pow: u64) -> bool
fn divisible_by_power_of_2(self, pow: u64) -> bool
Returns whether a number is divisible by $2^k$.
$f(x, k) = (2^k|x)$.
$f(x, k) = (\exists n \in \N : \ x = n2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleByPowerOf2 for i8
impl DivisibleByPowerOf2 for i8
sourcefn divisible_by_power_of_2(self, pow: u64) -> bool
fn divisible_by_power_of_2(self, pow: u64) -> bool
Returns whether a number is divisible by $2^k$.
$f(x, k) = (2^k|x)$.
$f(x, k) = (\exists n \in \N : x = n2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleByPowerOf2 for i16
impl DivisibleByPowerOf2 for i16
sourcefn divisible_by_power_of_2(self, pow: u64) -> bool
fn divisible_by_power_of_2(self, pow: u64) -> bool
Returns whether a number is divisible by $2^k$.
$f(x, k) = (2^k|x)$.
$f(x, k) = (\exists n \in \N : x = n2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleByPowerOf2 for i32
impl DivisibleByPowerOf2 for i32
sourcefn divisible_by_power_of_2(self, pow: u64) -> bool
fn divisible_by_power_of_2(self, pow: u64) -> bool
Returns whether a number is divisible by $2^k$.
$f(x, k) = (2^k|x)$.
$f(x, k) = (\exists n \in \N : x = n2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleByPowerOf2 for i64
impl DivisibleByPowerOf2 for i64
sourcefn divisible_by_power_of_2(self, pow: u64) -> bool
fn divisible_by_power_of_2(self, pow: u64) -> bool
Returns whether a number is divisible by $2^k$.
$f(x, k) = (2^k|x)$.
$f(x, k) = (\exists n \in \N : x = n2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleByPowerOf2 for i128
impl DivisibleByPowerOf2 for i128
sourcefn divisible_by_power_of_2(self, pow: u64) -> bool
fn divisible_by_power_of_2(self, pow: u64) -> bool
Returns whether a number is divisible by $2^k$.
$f(x, k) = (2^k|x)$.
$f(x, k) = (\exists n \in \N : x = n2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleByPowerOf2 for isize
impl DivisibleByPowerOf2 for isize
sourcefn divisible_by_power_of_2(self, pow: u64) -> bool
fn divisible_by_power_of_2(self, pow: u64) -> bool
Returns whether a number is divisible by $2^k$.
$f(x, k) = (2^k|x)$.
$f(x, k) = (\exists n \in \N : x = n2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.