pub trait DivisibleByPowerOf2 {
// Required method
fn divisible_by_power_of_2(self, pow: u64) -> bool;
}
Expand description
Determines whether a number is divisible by $2^k$.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.