pub trait ArithmeticCheckedShl<RHS> {
    type Output;

    fn arithmetic_checked_shl(self, other: RHS) -> Option<Self::Output>;
}
Expand description

Left-shifts a number (multiplies it by a power of 2), returning None if the result is not representable.

Required Associated Types

Required Methods

Implementations on Foreign Types

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad 2^b x \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0).

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and}\ 2^b x < 2^W, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ 2^b x \geq 2^W, \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad 2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}, \\ \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Left-shifts a number (multiplies it by a power of 2). If the result is too large to be represented, None is returned.

Zero may be shifted by any amount, and any number may be shifted by any negative amount; shifting by a negative amount with a high absolute value returns Some(0) if self is positive, and Some(-1) if self is negative.

$$ f(x, b) = \begin{cases} \operatorname{Some}(2^b x) & \text{if} \quad b \geq 0 \ \mathrm{and} \ -2^{W-1} \leq 2^b x < 2^{W-1}, \\ \operatorname{None} & \text{if} \quad b \geq 0 \ \mathrm{and} \ (2^b x < -2^{W-1} \ \mathrm{or} \ 2^b x \geq 2^{W-1}), \\ \operatorname{Some}(\lfloor x/2^{-b} \rfloor) & \text{if} \quad b < 0, \end{cases} $$ where $W$ is Self::WIDTH.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Implementors