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

Implementations on Foreign Types

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.

Implementors