Expand description
Various traits for converting numbers.
Traits§
- Convertible
From - Tests whether a value of one type is convertible into a value of another.
- Digits
- Expresses a value as a
Vec
of digits, or reads a value from an iterator of digits. - Exact
From - Converts a value from one type to another. If the conversion fails, the function panics.
- Exact
Into - Converts a value from one type to another. If the conversion fails, the function panics.
- From
Other Type Slice - Converts a slice of one type of value to a single value of another type.
- From
SciString - Converts a
&str
, possibly in scientific notation, to a number. - From
String Base - Converts a string slice in a given base to a value.
- HasHalf
- Associates with
Self
a type that’s halfSelf
’s size. - Integer
Mantissa AndExponent - Converts a number to or from an integer mantissa and exponent.
- IsInteger
- Determines whether a number is an integer.
- Join
Halves - Provides a function to join two pieces into a number. For example, two
u32
s may be joined to form au64
. - Overflowing
From - 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. - Overflowing
Into - 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. - Power
Of2Digit Iterable - Creates an iterator over a value’s base-$2^k$ digits.
- Power
Of2Digit Iterator - An iterator over a value’s base-$2^k$ digits.
- Power
Of2Digits - Expresses a value as a
Vec
of base-$2^k$ digits, or reads a value from an iterator of base-$2^k$ digits. - RawMantissa
AndExponent - Converts a number to or from a raw mantissa and exponent.
- Rounding
From - Converts a value from one type to another, where the conversion is made according to a specified
RoundingMode
. AnOrdering
is also returned, indicating whether the returned value is less than, equal to, or greater than the original value. - Rounding
Into - Converts a value from one type to another, where the conversion is made according to a specified
RoundingMode
. AnOrdering
is also returned, indicating whether the returned value is less than, equal to, or greater than the original value. - Saturating
From - 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.
- Saturating
Into - 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.
- SciMantissa
AndExponent - Converts a number to or from a scientific mantissa and exponent.
- Split
InHalf - Provides functions to split a number into two pieces. For example, a
u64
may be split into twou32
s. - ToSci
- Converts a number to a string, possibly in scientific notation.
- ToString
Base - Converts a number to a string using a specified base.
- VecFrom
Other Type - Converts a slice of one type of value to a
Vec
of another type. - VecFrom
Other Type Slice - Converts a slice of one type of value to a
Vec
of another type. - Wrapping
From - Converts a value from one type to another. where if the conversion is not exact the result will wrap around.
- Wrapping
Into - Converts a value from one type to another, where if the conversion is not exact the result will wrap around.