pub trait LowMask {
    fn low_mask(bits: u64) -> Self;
}
Expand description

Returns a number whose least significant $b$ bits are true and whose other bits are false.

Required Methods

Implementations on Foreign Types

Returns a number whose least significant $b$ bits are true and whose other bits are false.

$f(b) = 2^b - 1$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if bits is greater than the width of of the type.

Examples

See here.

Returns a number whose least significant $b$ bits are true and whose other bits are false.

$f(b) = 2^b - 1$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if bits is greater than the width of of the type.

Examples

See here.

Returns a number whose least significant $b$ bits are true and whose other bits are false.

$f(b) = 2^b - 1$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if bits is greater than the width of of the type.

Examples

See here.

Returns a number whose least significant $b$ bits are true and whose other bits are false.

$f(b) = 2^b - 1$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if bits is greater than the width of of the type.

Examples

See here.

Returns a number whose least significant $b$ bits are true and whose other bits are false.

$f(b) = 2^b - 1$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if bits is greater than the width of of the type.

Examples

See here.

Returns a number whose least significant $b$ bits are true and whose other bits are false.

$f(b) = 2^b - 1$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if bits is greater than the width of of the type.

Examples

See here.

Returns a number whose least significant $b$ bits are true and whose other bits are false.

$$ f(b) = \begin{cases} 2^b - 1 & \text{if} \quad 0 \leq n < W, \\ -1 & \text{if} \quad n = W, \end{cases} $$ where $W$ is the width of the type.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if bits is greater than the width of the type.

Examples

See here.

Returns a number whose least significant $b$ bits are true and whose other bits are false.

$$ f(b) = \begin{cases} 2^b - 1 & \text{if} \quad 0 \leq n < W, \\ -1 & \text{if} \quad n = W, \end{cases} $$ where $W$ is the width of the type.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if bits is greater than the width of the type.

Examples

See here.

Returns a number whose least significant $b$ bits are true and whose other bits are false.

$$ f(b) = \begin{cases} 2^b - 1 & \text{if} \quad 0 \leq n < W, \\ -1 & \text{if} \quad n = W, \end{cases} $$ where $W$ is the width of the type.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if bits is greater than the width of the type.

Examples

See here.

Returns a number whose least significant $b$ bits are true and whose other bits are false.

$$ f(b) = \begin{cases} 2^b - 1 & \text{if} \quad 0 \leq n < W, \\ -1 & \text{if} \quad n = W, \end{cases} $$ where $W$ is the width of the type.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if bits is greater than the width of the type.

Examples

See here.

Returns a number whose least significant $b$ bits are true and whose other bits are false.

$$ f(b) = \begin{cases} 2^b - 1 & \text{if} \quad 0 \leq n < W, \\ -1 & \text{if} \quad n = W, \end{cases} $$ where $W$ is the width of the type.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if bits is greater than the width of the type.

Examples

See here.

Returns a number whose least significant $b$ bits are true and whose other bits are false.

$$ f(b) = \begin{cases} 2^b - 1 & \text{if} \quad 0 \leq n < W, \\ -1 & \text{if} \quad n = W, \end{cases} $$ where $W$ is the width of the type.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if bits is greater than the width of the type.

Examples

See here.

Implementors