pub trait CheckedFrom<T>: Sized {
    fn checked_from(value: T) -> Option<Self>;
}
Expand description

Converts a value from one type to another. If the conversion fails, None is returned.

If CheckedFrom is implemented, it usually makes sense to implement ConvertibleFrom as well.

Required Methods

Implementations on Foreign Types

Converts a value to its own type. Since this conversion is always valid and always leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to its own type. Since this conversion is always valid and always leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to its own type. Since this conversion is always valid and always leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to its own type. Since this conversion is always valid and always leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to its own type. Since this conversion is always valid and always leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to its own type. Since this conversion is always valid and always leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to its own type. Since this conversion is always valid and always leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to its own type. Since this conversion is always valid and always leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to its own type. Since this conversion is always valid and always leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to its own type. Since this conversion is always valid and always leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to its own type. Since this conversion is always valid and always leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to its own type. Since this conversion is always valid and always leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. Since this conversion is always lossless and leaves the value unchanged, None is never returned.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value to another type. If the value cannot be represented in the new type, None is returned.

Let $W$ be the width of the target type.

If the target type is unsigned, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad 0 \leq n < 2^W, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

If the target type is signed, then $$ f_W(n) = \begin{cases} \operatorname{Some}(n) & \text{if} \quad -2^{W-1} \leq n < 2^{W-1}-1, \\ \operatorname{None} & \text{otherwise}. \end{cases} $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of an unsigned type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the unsigned value is not too large to represent (which can only happen when converting a u128 to an f32) and the precision of the unsigned value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of an unsigned type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer, not negative (negative zero is ok), and not too large.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of an unsigned type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the unsigned value is not too large to represent (which can only happen when converting a u128 to an f32) and the precision of the unsigned value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of an unsigned type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer, not negative (negative zero is ok), and not too large.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of an unsigned type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the unsigned value is not too large to represent (which can only happen when converting a u128 to an f32) and the precision of the unsigned value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of an unsigned type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer, not negative (negative zero is ok), and not too large.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of an unsigned type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the unsigned value is not too large to represent (which can only happen when converting a u128 to an f32) and the precision of the unsigned value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of an unsigned type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer, not negative (negative zero is ok), and not too large.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of an unsigned type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the unsigned value is not too large to represent (which can only happen when converting a u128 to an f32) and the precision of the unsigned value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of an unsigned type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer, not negative (negative zero is ok), and not too large.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of an unsigned type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the unsigned value is not too large to represent (which can only happen when converting a u128 to an f32) and the precision of the unsigned value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of an unsigned type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer, not negative (negative zero is ok), and not too large.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of an unsigned type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the unsigned value is not too large to represent (which can only happen when converting a u128 to an f32) and the precision of the unsigned value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of an unsigned type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer, not negative (negative zero is ok), and not too large.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of an unsigned type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the unsigned value is not too large to represent (which can only happen when converting a u128 to an f32) and the precision of the unsigned value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of an unsigned type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer, not negative (negative zero is ok), and not too large.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of an unsigned type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the unsigned value is not too large to represent (which can only happen when converting a u128 to an f32) and the precision of the unsigned value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of an unsigned type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer, not negative (negative zero is ok), and not too large.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of an unsigned type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the unsigned value is not too large to represent (which can only happen when converting a u128 to an f32) and the precision of the unsigned value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of an unsigned type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer, not negative (negative zero is ok), and not too large.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of an unsigned type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the unsigned value is not too large to represent (which can only happen when converting a u128 to an f32) and the precision of the unsigned value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of an unsigned type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer, not negative (negative zero is ok), and not too large.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of an unsigned type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the unsigned value is not too large to represent (which can only happen when converting a u128 to an f32) and the precision of the unsigned value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of an unsigned type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer, not negative (negative zero is ok), and not too large.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a signed type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the precision of the signed value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of a signed type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer and not too large or too small.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a signed type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the precision of the signed value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of a signed type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer and not too large or too small.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a signed type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the precision of the signed value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of a signed type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer and not too large or too small.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a signed type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the precision of the signed value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of a signed type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer and not too large or too small.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a signed type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the precision of the signed value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of a signed type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer and not too large or too small.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a signed type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the precision of the signed value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of a signed type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer and not too large or too small.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a signed type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the precision of the signed value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of a signed type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer and not too large or too small.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a signed type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the precision of the signed value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of a signed type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer and not too large or too small.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a signed type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the precision of the signed value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of a signed type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer and not too large or too small.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a signed type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the precision of the signed value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of a signed type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer and not too large or too small.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a signed type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the precision of the signed value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of a signed type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer and not too large or too small.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a signed type to a value of a floating point type, returning None if an exact conversion is not possible.

The conversion succeeds if the precision of the signed value is not too high.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Converts a value of a floating point type to a value of a signed type, returning None if an exact conversion is not possible.

The conversion succeeds if the floating point value is an integer and not too large or too small.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Implementors