Module malachite_base::num::conversion::traits
source · [−]Expand description
Various traits for converting numbers.
Traits
Converts a value from one type to another. If the conversion fails, None
is returned.
Converts a value from one type to another. If the conversion fails, None
is returned.
Tests whether a value of one type is convertible into a value of another.
Converts a value from one type to another. If the conversion fails, the function panics.
Converts a value from one type to another. If the conversion fails, the function panics.
Converts a slice of one type of value to a single value of another type.
Converts a &str
, possibly in scientific notation, to a number.
Converts a string slice in a given base to a value.
Associates with Self
a type that’s half Self
’s size.
Converts a number to or from an integer mantissa and exponent.
Determines whether a number is an integer.
Converts a value from one type to another, where if the conversion is not exact the result will
wrap around. The result is returned along with a bool
that indicates whether wrapping has
occurred.
Converts a value from one type to another, where if the conversion is not exact the result will
wrap around. The result is returned along with a bool
that indicates whether wrapping has
occurred.
Creates an iterator over a value’s base-$2^k$ digits.
An iterator over a value’s base-$2^k$ digits.
Expresses a value as a Vec
of base-$2^k$ digits, or reads a value from an iterator of
base-$2^k$ digits.
Converts a number to or from a raw mantissa and exponent.
Converts a value from one type to another, where the conversion is made according to a
specified RoundingMode
.
Converts a value from one type to another, where the conversion is made according to a
specified RoundingMode
.
Converts a value from one type to another, where if the conversion is not exact the result is set to the maximum or minimum value of the result type, whichever is closer.
Converts a value from one type to another, where if the conversion is not exact the result is set to the maximum or minimum value of the result type, whichever is closer.
Converts a number to or from a scientific mantissa and exponent.
Converts a number to a string, possibly in scientific notation.
Converts a number to a string using a specified base.
Converts a slice of one type of value to a Vec
of another type.
Converts a slice of one type of value to a Vec
of another type.
Converts a value from one type to another. where if the conversion is not exact the result will wrap around.
Converts a value from one type to another, where if the conversion is not exact the result will wrap around.