#[repr(transparent)]pub struct F128Bits(pub u128);
F128
insteadExpand description
The bit representation of a binary128 floating-point number (f128
).
This type can be used to
- convert between fixed-point numbers and the bit representation of 128-bit floating-point numbers.
- compare fixed-point numbers and the bit representation of 128-bit floating-point numbers.
This is deprecated, and F128
should be used instead. There are two main
differences to keep in mind when switching to F128
:
- The ordering for
F128Bits
is total ordering, not regular floating-point number ordering, while the ordering forF128
is similar to ordering for standard floating-point numbers. - The underlying
u128
value forF128Bits
is accessible as a public field, while forF128
it is accessible only through theto_bits
andfrom_bits
methods.
Tuple Fields§
§0: u128
F128
insteadTrait Implementations§
source§impl<Frac: LeEqU128> CheckedCast<F128Bits> for FixedI128<Frac>
impl<Frac: LeEqU128> CheckedCast<F128Bits> for FixedI128<Frac>
source§fn checked_cast(self) -> Option<F128Bits>
fn checked_cast(self) -> Option<F128Bits>
source§impl<Frac: LeEqU16> CheckedCast<F128Bits> for FixedI16<Frac>
impl<Frac: LeEqU16> CheckedCast<F128Bits> for FixedI16<Frac>
source§fn checked_cast(self) -> Option<F128Bits>
fn checked_cast(self) -> Option<F128Bits>
source§impl<Frac: LeEqU32> CheckedCast<F128Bits> for FixedI32<Frac>
impl<Frac: LeEqU32> CheckedCast<F128Bits> for FixedI32<Frac>
source§fn checked_cast(self) -> Option<F128Bits>
fn checked_cast(self) -> Option<F128Bits>
source§impl<Frac: LeEqU64> CheckedCast<F128Bits> for FixedI64<Frac>
impl<Frac: LeEqU64> CheckedCast<F128Bits> for FixedI64<Frac>
source§fn checked_cast(self) -> Option<F128Bits>
fn checked_cast(self) -> Option<F128Bits>
source§impl<Frac: LeEqU8> CheckedCast<F128Bits> for FixedI8<Frac>
impl<Frac: LeEqU8> CheckedCast<F128Bits> for FixedI8<Frac>
source§fn checked_cast(self) -> Option<F128Bits>
fn checked_cast(self) -> Option<F128Bits>
source§impl<Frac: LeEqU128> CheckedCast<F128Bits> for FixedU128<Frac>
impl<Frac: LeEqU128> CheckedCast<F128Bits> for FixedU128<Frac>
source§fn checked_cast(self) -> Option<F128Bits>
fn checked_cast(self) -> Option<F128Bits>
source§impl<Frac: LeEqU16> CheckedCast<F128Bits> for FixedU16<Frac>
impl<Frac: LeEqU16> CheckedCast<F128Bits> for FixedU16<Frac>
source§fn checked_cast(self) -> Option<F128Bits>
fn checked_cast(self) -> Option<F128Bits>
source§impl<Frac: LeEqU32> CheckedCast<F128Bits> for FixedU32<Frac>
impl<Frac: LeEqU32> CheckedCast<F128Bits> for FixedU32<Frac>
source§fn checked_cast(self) -> Option<F128Bits>
fn checked_cast(self) -> Option<F128Bits>
source§impl<Frac: LeEqU64> CheckedCast<F128Bits> for FixedU64<Frac>
impl<Frac: LeEqU64> CheckedCast<F128Bits> for FixedU64<Frac>
source§fn checked_cast(self) -> Option<F128Bits>
fn checked_cast(self) -> Option<F128Bits>
source§impl<Frac: LeEqU8> CheckedCast<F128Bits> for FixedU8<Frac>
impl<Frac: LeEqU8> CheckedCast<F128Bits> for FixedU8<Frac>
source§fn checked_cast(self) -> Option<F128Bits>
fn checked_cast(self) -> Option<F128Bits>
source§impl<Frac: LeEqU128> CheckedCast<FixedI128<Frac>> for F128Bits
impl<Frac: LeEqU128> CheckedCast<FixedI128<Frac>> for F128Bits
source§fn checked_cast(self) -> Option<FixedI128<Frac>>
fn checked_cast(self) -> Option<FixedI128<Frac>>
source§impl<Frac: LeEqU16> CheckedCast<FixedI16<Frac>> for F128Bits
impl<Frac: LeEqU16> CheckedCast<FixedI16<Frac>> for F128Bits
source§fn checked_cast(self) -> Option<FixedI16<Frac>>
fn checked_cast(self) -> Option<FixedI16<Frac>>
source§impl<Frac: LeEqU32> CheckedCast<FixedI32<Frac>> for F128Bits
impl<Frac: LeEqU32> CheckedCast<FixedI32<Frac>> for F128Bits
source§fn checked_cast(self) -> Option<FixedI32<Frac>>
fn checked_cast(self) -> Option<FixedI32<Frac>>
source§impl<Frac: LeEqU64> CheckedCast<FixedI64<Frac>> for F128Bits
impl<Frac: LeEqU64> CheckedCast<FixedI64<Frac>> for F128Bits
source§fn checked_cast(self) -> Option<FixedI64<Frac>>
fn checked_cast(self) -> Option<FixedI64<Frac>>
source§impl<Frac: LeEqU8> CheckedCast<FixedI8<Frac>> for F128Bits
impl<Frac: LeEqU8> CheckedCast<FixedI8<Frac>> for F128Bits
source§fn checked_cast(self) -> Option<FixedI8<Frac>>
fn checked_cast(self) -> Option<FixedI8<Frac>>
source§impl<Frac: LeEqU128> CheckedCast<FixedU128<Frac>> for F128Bits
impl<Frac: LeEqU128> CheckedCast<FixedU128<Frac>> for F128Bits
source§fn checked_cast(self) -> Option<FixedU128<Frac>>
fn checked_cast(self) -> Option<FixedU128<Frac>>
source§impl<Frac: LeEqU16> CheckedCast<FixedU16<Frac>> for F128Bits
impl<Frac: LeEqU16> CheckedCast<FixedU16<Frac>> for F128Bits
source§fn checked_cast(self) -> Option<FixedU16<Frac>>
fn checked_cast(self) -> Option<FixedU16<Frac>>
source§impl<Frac: LeEqU32> CheckedCast<FixedU32<Frac>> for F128Bits
impl<Frac: LeEqU32> CheckedCast<FixedU32<Frac>> for F128Bits
source§fn checked_cast(self) -> Option<FixedU32<Frac>>
fn checked_cast(self) -> Option<FixedU32<Frac>>
source§impl<Frac: LeEqU64> CheckedCast<FixedU64<Frac>> for F128Bits
impl<Frac: LeEqU64> CheckedCast<FixedU64<Frac>> for F128Bits
source§fn checked_cast(self) -> Option<FixedU64<Frac>>
fn checked_cast(self) -> Option<FixedU64<Frac>>
source§impl<Frac: LeEqU8> CheckedCast<FixedU8<Frac>> for F128Bits
impl<Frac: LeEqU8> CheckedCast<FixedU8<Frac>> for F128Bits
source§fn checked_cast(self) -> Option<FixedU8<Frac>>
fn checked_cast(self) -> Option<FixedU8<Frac>>
source§impl FromFixed for F128Bits
impl FromFixed for F128Bits
source§fn from_fixed<F: Fixed>(src: F) -> Self
fn from_fixed<F: Fixed>(src: F) -> Self
Converts a fixed-point number to a floating-point number.
Rounding is to the nearest, with ties rounded to even.
§Panics
When debug assertions are enabled, panics if the value
does not fit. When debug assertions are not enabled,
the wrapped value can be returned, but it is not
considered a breaking change if in the future it
panics; if wrapping is required use
wrapping_from_fixed
instead.
source§fn checked_from_fixed<F: Fixed>(src: F) -> Option<Self>
fn checked_from_fixed<F: Fixed>(src: F) -> Option<Self>
Converts a fixed-point number to a floating-point
number if it fits, otherwise returns None
.
Rounding is to the nearest, with ties rounded to even.
source§fn saturating_from_fixed<F: Fixed>(src: F) -> Self
fn saturating_from_fixed<F: Fixed>(src: F) -> Self
Converts a fixed-point number to a floating-point number, saturating if it does not fit.
Rounding is to the nearest, with ties rounded to even.
source§fn wrapping_from_fixed<F: Fixed>(src: F) -> Self
fn wrapping_from_fixed<F: Fixed>(src: F) -> Self
Converts a fixed-point number to a floating-point number, wrapping if it does not fit.
Rounding is to the nearest, with ties rounded to even.
source§fn overflowing_from_fixed<F: Fixed>(src: F) -> (Self, bool)
fn overflowing_from_fixed<F: Fixed>(src: F) -> (Self, bool)
source§fn unwrapped_from_fixed<F: Fixed>(src: F) -> Self
fn unwrapped_from_fixed<F: Fixed>(src: F) -> Self
Converts a fixed-point number to a floating-point number, panicking if it does not fit.
Rounding is to the nearest, with ties rounded to even.
§Panics
Panics if the value does not fit, even when debug assertions are not enabled.
source§impl LosslessTryFrom<i16> for F128Bits
impl LosslessTryFrom<i16> for F128Bits
source§impl LosslessTryFrom<i32> for F128Bits
impl LosslessTryFrom<i32> for F128Bits
source§impl LosslessTryFrom<i64> for F128Bits
impl LosslessTryFrom<i64> for F128Bits
source§impl LosslessTryFrom<i8> for F128Bits
impl LosslessTryFrom<i8> for F128Bits
source§impl LosslessTryFrom<u16> for F128Bits
impl LosslessTryFrom<u16> for F128Bits
source§impl LosslessTryFrom<u32> for F128Bits
impl LosslessTryFrom<u32> for F128Bits
source§impl LosslessTryFrom<u64> for F128Bits
impl LosslessTryFrom<u64> for F128Bits
source§impl LosslessTryFrom<u8> for F128Bits
impl LosslessTryFrom<u8> for F128Bits
source§impl<Frac: LeEqU128> LossyFrom<FixedI128<Frac>> for F128Bits
impl<Frac: LeEqU128> LossyFrom<FixedI128<Frac>> for F128Bits
source§fn lossy_from(src: FixedI128<Frac>) -> F128Bits
fn lossy_from(src: FixedI128<Frac>) -> F128Bits
Converts a fixed-point number to a floating-point number.
This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.
source§impl<Frac: LeEqU16> LossyFrom<FixedI16<Frac>> for F128Bits
impl<Frac: LeEqU16> LossyFrom<FixedI16<Frac>> for F128Bits
source§fn lossy_from(src: FixedI16<Frac>) -> F128Bits
fn lossy_from(src: FixedI16<Frac>) -> F128Bits
Converts a fixed-point number to a floating-point number.
This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.
source§impl<Frac: LeEqU32> LossyFrom<FixedI32<Frac>> for F128Bits
impl<Frac: LeEqU32> LossyFrom<FixedI32<Frac>> for F128Bits
source§fn lossy_from(src: FixedI32<Frac>) -> F128Bits
fn lossy_from(src: FixedI32<Frac>) -> F128Bits
Converts a fixed-point number to a floating-point number.
This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.
source§impl<Frac: LeEqU64> LossyFrom<FixedI64<Frac>> for F128Bits
impl<Frac: LeEqU64> LossyFrom<FixedI64<Frac>> for F128Bits
source§fn lossy_from(src: FixedI64<Frac>) -> F128Bits
fn lossy_from(src: FixedI64<Frac>) -> F128Bits
Converts a fixed-point number to a floating-point number.
This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.
source§impl<Frac: LeEqU8> LossyFrom<FixedI8<Frac>> for F128Bits
impl<Frac: LeEqU8> LossyFrom<FixedI8<Frac>> for F128Bits
source§fn lossy_from(src: FixedI8<Frac>) -> F128Bits
fn lossy_from(src: FixedI8<Frac>) -> F128Bits
Converts a fixed-point number to a floating-point number.
This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.
source§impl<Frac: LeEqU128> LossyFrom<FixedU128<Frac>> for F128Bits
impl<Frac: LeEqU128> LossyFrom<FixedU128<Frac>> for F128Bits
source§fn lossy_from(src: FixedU128<Frac>) -> F128Bits
fn lossy_from(src: FixedU128<Frac>) -> F128Bits
Converts a fixed-point number to a floating-point number.
This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.
source§impl<Frac: LeEqU16> LossyFrom<FixedU16<Frac>> for F128Bits
impl<Frac: LeEqU16> LossyFrom<FixedU16<Frac>> for F128Bits
source§fn lossy_from(src: FixedU16<Frac>) -> F128Bits
fn lossy_from(src: FixedU16<Frac>) -> F128Bits
Converts a fixed-point number to a floating-point number.
This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.
source§impl<Frac: LeEqU32> LossyFrom<FixedU32<Frac>> for F128Bits
impl<Frac: LeEqU32> LossyFrom<FixedU32<Frac>> for F128Bits
source§fn lossy_from(src: FixedU32<Frac>) -> F128Bits
fn lossy_from(src: FixedU32<Frac>) -> F128Bits
Converts a fixed-point number to a floating-point number.
This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.
source§impl<Frac: LeEqU64> LossyFrom<FixedU64<Frac>> for F128Bits
impl<Frac: LeEqU64> LossyFrom<FixedU64<Frac>> for F128Bits
source§fn lossy_from(src: FixedU64<Frac>) -> F128Bits
fn lossy_from(src: FixedU64<Frac>) -> F128Bits
Converts a fixed-point number to a floating-point number.
This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.
source§impl<Frac: LeEqU8> LossyFrom<FixedU8<Frac>> for F128Bits
impl<Frac: LeEqU8> LossyFrom<FixedU8<Frac>> for F128Bits
source§fn lossy_from(src: FixedU8<Frac>) -> F128Bits
fn lossy_from(src: FixedU8<Frac>) -> F128Bits
Converts a fixed-point number to a floating-point number.
This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.
source§impl LossyFrom<i128> for F128Bits
impl LossyFrom<i128> for F128Bits
source§fn lossy_from(src: i128) -> F128Bits
fn lossy_from(src: i128) -> F128Bits
Converts an integer to a floating-point number.
This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.
source§impl LossyFrom<i16> for F128Bits
impl LossyFrom<i16> for F128Bits
source§fn lossy_from(src: i16) -> F128Bits
fn lossy_from(src: i16) -> F128Bits
Converts an integer to a floating-point number.
This conversion never fails (infallible) and actually does not lose precision (lossless).
source§impl LossyFrom<i32> for F128Bits
impl LossyFrom<i32> for F128Bits
source§fn lossy_from(src: i32) -> F128Bits
fn lossy_from(src: i32) -> F128Bits
Converts an integer to a floating-point number.
This conversion never fails (infallible) and actually does not lose precision (lossless).
source§impl LossyFrom<i64> for F128Bits
impl LossyFrom<i64> for F128Bits
source§fn lossy_from(src: i64) -> F128Bits
fn lossy_from(src: i64) -> F128Bits
Converts an integer to a floating-point number.
This conversion never fails (infallible) and actually does not lose precision (lossless).
source§impl LossyFrom<i8> for F128Bits
impl LossyFrom<i8> for F128Bits
source§fn lossy_from(src: i8) -> F128Bits
fn lossy_from(src: i8) -> F128Bits
Converts an integer to a floating-point number.
This conversion never fails (infallible) and actually does not lose precision (lossless).
source§impl LossyFrom<isize> for F128Bits
impl LossyFrom<isize> for F128Bits
source§fn lossy_from(src: isize) -> F128Bits
fn lossy_from(src: isize) -> F128Bits
Converts an integer to a floating-point number.
This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.
source§impl LossyFrom<u128> for F128Bits
impl LossyFrom<u128> for F128Bits
source§fn lossy_from(src: u128) -> F128Bits
fn lossy_from(src: u128) -> F128Bits
Converts an integer to a floating-point number.
This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.
source§impl LossyFrom<u16> for F128Bits
impl LossyFrom<u16> for F128Bits
source§fn lossy_from(src: u16) -> F128Bits
fn lossy_from(src: u16) -> F128Bits
Converts an integer to a floating-point number.
This conversion never fails (infallible) and actually does not lose precision (lossless).
source§impl LossyFrom<u32> for F128Bits
impl LossyFrom<u32> for F128Bits
source§fn lossy_from(src: u32) -> F128Bits
fn lossy_from(src: u32) -> F128Bits
Converts an integer to a floating-point number.
This conversion never fails (infallible) and actually does not lose precision (lossless).
source§impl LossyFrom<u64> for F128Bits
impl LossyFrom<u64> for F128Bits
source§fn lossy_from(src: u64) -> F128Bits
fn lossy_from(src: u64) -> F128Bits
Converts an integer to a floating-point number.
This conversion never fails (infallible) and actually does not lose precision (lossless).
source§impl LossyFrom<u8> for F128Bits
impl LossyFrom<u8> for F128Bits
source§fn lossy_from(src: u8) -> F128Bits
fn lossy_from(src: u8) -> F128Bits
Converts an integer to a floating-point number.
This conversion never fails (infallible) and actually does not lose precision (lossless).
source§impl LossyFrom<usize> for F128Bits
impl LossyFrom<usize> for F128Bits
source§fn lossy_from(src: usize) -> F128Bits
fn lossy_from(src: usize) -> F128Bits
Converts an integer to a floating-point number.
This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.
source§impl Ord for F128Bits
impl Ord for F128Bits
source§impl<Frac: LeEqU128> OverflowingCast<F128Bits> for FixedI128<Frac>
impl<Frac: LeEqU128> OverflowingCast<F128Bits> for FixedI128<Frac>
source§fn overflowing_cast(self) -> (F128Bits, bool)
fn overflowing_cast(self) -> (F128Bits, bool)
source§impl<Frac: LeEqU16> OverflowingCast<F128Bits> for FixedI16<Frac>
impl<Frac: LeEqU16> OverflowingCast<F128Bits> for FixedI16<Frac>
source§fn overflowing_cast(self) -> (F128Bits, bool)
fn overflowing_cast(self) -> (F128Bits, bool)
source§impl<Frac: LeEqU32> OverflowingCast<F128Bits> for FixedI32<Frac>
impl<Frac: LeEqU32> OverflowingCast<F128Bits> for FixedI32<Frac>
source§fn overflowing_cast(self) -> (F128Bits, bool)
fn overflowing_cast(self) -> (F128Bits, bool)
source§impl<Frac: LeEqU64> OverflowingCast<F128Bits> for FixedI64<Frac>
impl<Frac: LeEqU64> OverflowingCast<F128Bits> for FixedI64<Frac>
source§fn overflowing_cast(self) -> (F128Bits, bool)
fn overflowing_cast(self) -> (F128Bits, bool)
source§impl<Frac: LeEqU8> OverflowingCast<F128Bits> for FixedI8<Frac>
impl<Frac: LeEqU8> OverflowingCast<F128Bits> for FixedI8<Frac>
source§fn overflowing_cast(self) -> (F128Bits, bool)
fn overflowing_cast(self) -> (F128Bits, bool)
source§impl<Frac: LeEqU128> OverflowingCast<F128Bits> for FixedU128<Frac>
impl<Frac: LeEqU128> OverflowingCast<F128Bits> for FixedU128<Frac>
source§fn overflowing_cast(self) -> (F128Bits, bool)
fn overflowing_cast(self) -> (F128Bits, bool)
source§impl<Frac: LeEqU16> OverflowingCast<F128Bits> for FixedU16<Frac>
impl<Frac: LeEqU16> OverflowingCast<F128Bits> for FixedU16<Frac>
source§fn overflowing_cast(self) -> (F128Bits, bool)
fn overflowing_cast(self) -> (F128Bits, bool)
source§impl<Frac: LeEqU32> OverflowingCast<F128Bits> for FixedU32<Frac>
impl<Frac: LeEqU32> OverflowingCast<F128Bits> for FixedU32<Frac>
source§fn overflowing_cast(self) -> (F128Bits, bool)
fn overflowing_cast(self) -> (F128Bits, bool)
source§impl<Frac: LeEqU64> OverflowingCast<F128Bits> for FixedU64<Frac>
impl<Frac: LeEqU64> OverflowingCast<F128Bits> for FixedU64<Frac>
source§fn overflowing_cast(self) -> (F128Bits, bool)
fn overflowing_cast(self) -> (F128Bits, bool)
source§impl<Frac: LeEqU8> OverflowingCast<F128Bits> for FixedU8<Frac>
impl<Frac: LeEqU8> OverflowingCast<F128Bits> for FixedU8<Frac>
source§fn overflowing_cast(self) -> (F128Bits, bool)
fn overflowing_cast(self) -> (F128Bits, bool)
source§impl<Frac: LeEqU128> OverflowingCast<FixedI128<Frac>> for F128Bits
impl<Frac: LeEqU128> OverflowingCast<FixedI128<Frac>> for F128Bits
source§fn overflowing_cast(self) -> (FixedI128<Frac>, bool)
fn overflowing_cast(self) -> (FixedI128<Frac>, bool)
source§impl<Frac: LeEqU16> OverflowingCast<FixedI16<Frac>> for F128Bits
impl<Frac: LeEqU16> OverflowingCast<FixedI16<Frac>> for F128Bits
source§fn overflowing_cast(self) -> (FixedI16<Frac>, bool)
fn overflowing_cast(self) -> (FixedI16<Frac>, bool)
source§impl<Frac: LeEqU32> OverflowingCast<FixedI32<Frac>> for F128Bits
impl<Frac: LeEqU32> OverflowingCast<FixedI32<Frac>> for F128Bits
source§fn overflowing_cast(self) -> (FixedI32<Frac>, bool)
fn overflowing_cast(self) -> (FixedI32<Frac>, bool)
source§impl<Frac: LeEqU64> OverflowingCast<FixedI64<Frac>> for F128Bits
impl<Frac: LeEqU64> OverflowingCast<FixedI64<Frac>> for F128Bits
source§fn overflowing_cast(self) -> (FixedI64<Frac>, bool)
fn overflowing_cast(self) -> (FixedI64<Frac>, bool)
source§impl<Frac: LeEqU8> OverflowingCast<FixedI8<Frac>> for F128Bits
impl<Frac: LeEqU8> OverflowingCast<FixedI8<Frac>> for F128Bits
source§fn overflowing_cast(self) -> (FixedI8<Frac>, bool)
fn overflowing_cast(self) -> (FixedI8<Frac>, bool)
source§impl<Frac: LeEqU128> OverflowingCast<FixedU128<Frac>> for F128Bits
impl<Frac: LeEqU128> OverflowingCast<FixedU128<Frac>> for F128Bits
source§fn overflowing_cast(self) -> (FixedU128<Frac>, bool)
fn overflowing_cast(self) -> (FixedU128<Frac>, bool)
source§impl<Frac: LeEqU16> OverflowingCast<FixedU16<Frac>> for F128Bits
impl<Frac: LeEqU16> OverflowingCast<FixedU16<Frac>> for F128Bits
source§fn overflowing_cast(self) -> (FixedU16<Frac>, bool)
fn overflowing_cast(self) -> (FixedU16<Frac>, bool)
source§impl<Frac: LeEqU32> OverflowingCast<FixedU32<Frac>> for F128Bits
impl<Frac: LeEqU32> OverflowingCast<FixedU32<Frac>> for F128Bits
source§fn overflowing_cast(self) -> (FixedU32<Frac>, bool)
fn overflowing_cast(self) -> (FixedU32<Frac>, bool)
source§impl<Frac: LeEqU64> OverflowingCast<FixedU64<Frac>> for F128Bits
impl<Frac: LeEqU64> OverflowingCast<FixedU64<Frac>> for F128Bits
source§fn overflowing_cast(self) -> (FixedU64<Frac>, bool)
fn overflowing_cast(self) -> (FixedU64<Frac>, bool)
source§impl<Frac: LeEqU8> OverflowingCast<FixedU8<Frac>> for F128Bits
impl<Frac: LeEqU8> OverflowingCast<FixedU8<Frac>> for F128Bits
source§fn overflowing_cast(self) -> (FixedU8<Frac>, bool)
fn overflowing_cast(self) -> (FixedU8<Frac>, bool)
source§impl<Frac: Unsigned> PartialEq<F128Bits> for FixedI128<Frac>
impl<Frac: Unsigned> PartialEq<F128Bits> for FixedI128<Frac>
source§impl<Frac: Unsigned> PartialEq<F128Bits> for FixedI16<Frac>
impl<Frac: Unsigned> PartialEq<F128Bits> for FixedI16<Frac>
source§impl<Frac: Unsigned> PartialEq<F128Bits> for FixedI32<Frac>
impl<Frac: Unsigned> PartialEq<F128Bits> for FixedI32<Frac>
source§impl<Frac: Unsigned> PartialEq<F128Bits> for FixedI64<Frac>
impl<Frac: Unsigned> PartialEq<F128Bits> for FixedI64<Frac>
source§impl<Frac: Unsigned> PartialEq<F128Bits> for FixedI8<Frac>
impl<Frac: Unsigned> PartialEq<F128Bits> for FixedI8<Frac>
source§impl<Frac: Unsigned> PartialEq<F128Bits> for FixedU128<Frac>
impl<Frac: Unsigned> PartialEq<F128Bits> for FixedU128<Frac>
source§impl<Frac: Unsigned> PartialEq<F128Bits> for FixedU16<Frac>
impl<Frac: Unsigned> PartialEq<F128Bits> for FixedU16<Frac>
source§impl<Frac: Unsigned> PartialEq<F128Bits> for FixedU32<Frac>
impl<Frac: Unsigned> PartialEq<F128Bits> for FixedU32<Frac>
source§impl<Frac: Unsigned> PartialEq<F128Bits> for FixedU64<Frac>
impl<Frac: Unsigned> PartialEq<F128Bits> for FixedU64<Frac>
source§impl<Frac: Unsigned> PartialEq<F128Bits> for FixedU8<Frac>
impl<Frac: Unsigned> PartialEq<F128Bits> for FixedU8<Frac>
source§impl<Frac: Unsigned> PartialEq<FixedI128<Frac>> for F128Bits
impl<Frac: Unsigned> PartialEq<FixedI128<Frac>> for F128Bits
source§impl<Frac: Unsigned> PartialEq<FixedI16<Frac>> for F128Bits
impl<Frac: Unsigned> PartialEq<FixedI16<Frac>> for F128Bits
source§impl<Frac: Unsigned> PartialEq<FixedI32<Frac>> for F128Bits
impl<Frac: Unsigned> PartialEq<FixedI32<Frac>> for F128Bits
source§impl<Frac: Unsigned> PartialEq<FixedI64<Frac>> for F128Bits
impl<Frac: Unsigned> PartialEq<FixedI64<Frac>> for F128Bits
source§impl<Frac: Unsigned> PartialEq<FixedI8<Frac>> for F128Bits
impl<Frac: Unsigned> PartialEq<FixedI8<Frac>> for F128Bits
source§impl<Frac: Unsigned> PartialEq<FixedU128<Frac>> for F128Bits
impl<Frac: Unsigned> PartialEq<FixedU128<Frac>> for F128Bits
source§impl<Frac: Unsigned> PartialEq<FixedU16<Frac>> for F128Bits
impl<Frac: Unsigned> PartialEq<FixedU16<Frac>> for F128Bits
source§impl<Frac: Unsigned> PartialEq<FixedU32<Frac>> for F128Bits
impl<Frac: Unsigned> PartialEq<FixedU32<Frac>> for F128Bits
source§impl<Frac: Unsigned> PartialEq<FixedU64<Frac>> for F128Bits
impl<Frac: Unsigned> PartialEq<FixedU64<Frac>> for F128Bits
source§impl<Frac: Unsigned> PartialEq<FixedU8<Frac>> for F128Bits
impl<Frac: Unsigned> PartialEq<FixedU8<Frac>> for F128Bits
source§impl PartialEq for F128Bits
impl PartialEq for F128Bits
source§impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedI128<Frac>
impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedI128<Frac>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedI16<Frac>
impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedI16<Frac>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedI32<Frac>
impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedI32<Frac>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedI64<Frac>
impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedI64<Frac>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedI8<Frac>
impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedI8<Frac>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedU128<Frac>
impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedU128<Frac>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedU16<Frac>
impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedU16<Frac>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedU32<Frac>
impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedU32<Frac>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedU64<Frac>
impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedU64<Frac>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedU8<Frac>
impl<Frac: Unsigned> PartialOrd<F128Bits> for FixedU8<Frac>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<FixedI128<Frac>> for F128Bits
impl<Frac: Unsigned> PartialOrd<FixedI128<Frac>> for F128Bits
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<FixedI16<Frac>> for F128Bits
impl<Frac: Unsigned> PartialOrd<FixedI16<Frac>> for F128Bits
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<FixedI32<Frac>> for F128Bits
impl<Frac: Unsigned> PartialOrd<FixedI32<Frac>> for F128Bits
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<FixedI64<Frac>> for F128Bits
impl<Frac: Unsigned> PartialOrd<FixedI64<Frac>> for F128Bits
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<FixedI8<Frac>> for F128Bits
impl<Frac: Unsigned> PartialOrd<FixedI8<Frac>> for F128Bits
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<FixedU128<Frac>> for F128Bits
impl<Frac: Unsigned> PartialOrd<FixedU128<Frac>> for F128Bits
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<FixedU16<Frac>> for F128Bits
impl<Frac: Unsigned> PartialOrd<FixedU16<Frac>> for F128Bits
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<FixedU32<Frac>> for F128Bits
impl<Frac: Unsigned> PartialOrd<FixedU32<Frac>> for F128Bits
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<FixedU64<Frac>> for F128Bits
impl<Frac: Unsigned> PartialOrd<FixedU64<Frac>> for F128Bits
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: Unsigned> PartialOrd<FixedU8<Frac>> for F128Bits
impl<Frac: Unsigned> PartialOrd<FixedU8<Frac>> for F128Bits
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd for F128Bits
impl PartialOrd for F128Bits
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Frac: LeEqU128> SaturatingCast<F128Bits> for FixedI128<Frac>
impl<Frac: LeEqU128> SaturatingCast<F128Bits> for FixedI128<Frac>
source§fn saturating_cast(self) -> F128Bits
fn saturating_cast(self) -> F128Bits
source§impl<Frac: LeEqU16> SaturatingCast<F128Bits> for FixedI16<Frac>
impl<Frac: LeEqU16> SaturatingCast<F128Bits> for FixedI16<Frac>
source§fn saturating_cast(self) -> F128Bits
fn saturating_cast(self) -> F128Bits
source§impl<Frac: LeEqU32> SaturatingCast<F128Bits> for FixedI32<Frac>
impl<Frac: LeEqU32> SaturatingCast<F128Bits> for FixedI32<Frac>
source§fn saturating_cast(self) -> F128Bits
fn saturating_cast(self) -> F128Bits
source§impl<Frac: LeEqU64> SaturatingCast<F128Bits> for FixedI64<Frac>
impl<Frac: LeEqU64> SaturatingCast<F128Bits> for FixedI64<Frac>
source§fn saturating_cast(self) -> F128Bits
fn saturating_cast(self) -> F128Bits
source§impl<Frac: LeEqU8> SaturatingCast<F128Bits> for FixedI8<Frac>
impl<Frac: LeEqU8> SaturatingCast<F128Bits> for FixedI8<Frac>
source§fn saturating_cast(self) -> F128Bits
fn saturating_cast(self) -> F128Bits
source§impl<Frac: LeEqU128> SaturatingCast<F128Bits> for FixedU128<Frac>
impl<Frac: LeEqU128> SaturatingCast<F128Bits> for FixedU128<Frac>
source§fn saturating_cast(self) -> F128Bits
fn saturating_cast(self) -> F128Bits
source§impl<Frac: LeEqU16> SaturatingCast<F128Bits> for FixedU16<Frac>
impl<Frac: LeEqU16> SaturatingCast<F128Bits> for FixedU16<Frac>
source§fn saturating_cast(self) -> F128Bits
fn saturating_cast(self) -> F128Bits
source§impl<Frac: LeEqU32> SaturatingCast<F128Bits> for FixedU32<Frac>
impl<Frac: LeEqU32> SaturatingCast<F128Bits> for FixedU32<Frac>
source§fn saturating_cast(self) -> F128Bits
fn saturating_cast(self) -> F128Bits
source§impl<Frac: LeEqU64> SaturatingCast<F128Bits> for FixedU64<Frac>
impl<Frac: LeEqU64> SaturatingCast<F128Bits> for FixedU64<Frac>
source§fn saturating_cast(self) -> F128Bits
fn saturating_cast(self) -> F128Bits
source§impl<Frac: LeEqU8> SaturatingCast<F128Bits> for FixedU8<Frac>
impl<Frac: LeEqU8> SaturatingCast<F128Bits> for FixedU8<Frac>
source§fn saturating_cast(self) -> F128Bits
fn saturating_cast(self) -> F128Bits
source§impl<Frac: LeEqU128> SaturatingCast<FixedI128<Frac>> for F128Bits
impl<Frac: LeEqU128> SaturatingCast<FixedI128<Frac>> for F128Bits
source§fn saturating_cast(self) -> FixedI128<Frac>
fn saturating_cast(self) -> FixedI128<Frac>
source§impl<Frac: LeEqU16> SaturatingCast<FixedI16<Frac>> for F128Bits
impl<Frac: LeEqU16> SaturatingCast<FixedI16<Frac>> for F128Bits
source§fn saturating_cast(self) -> FixedI16<Frac>
fn saturating_cast(self) -> FixedI16<Frac>
source§impl<Frac: LeEqU32> SaturatingCast<FixedI32<Frac>> for F128Bits
impl<Frac: LeEqU32> SaturatingCast<FixedI32<Frac>> for F128Bits
source§fn saturating_cast(self) -> FixedI32<Frac>
fn saturating_cast(self) -> FixedI32<Frac>
source§impl<Frac: LeEqU64> SaturatingCast<FixedI64<Frac>> for F128Bits
impl<Frac: LeEqU64> SaturatingCast<FixedI64<Frac>> for F128Bits
source§fn saturating_cast(self) -> FixedI64<Frac>
fn saturating_cast(self) -> FixedI64<Frac>
source§impl<Frac: LeEqU8> SaturatingCast<FixedI8<Frac>> for F128Bits
impl<Frac: LeEqU8> SaturatingCast<FixedI8<Frac>> for F128Bits
source§fn saturating_cast(self) -> FixedI8<Frac>
fn saturating_cast(self) -> FixedI8<Frac>
source§impl<Frac: LeEqU128> SaturatingCast<FixedU128<Frac>> for F128Bits
impl<Frac: LeEqU128> SaturatingCast<FixedU128<Frac>> for F128Bits
source§fn saturating_cast(self) -> FixedU128<Frac>
fn saturating_cast(self) -> FixedU128<Frac>
source§impl<Frac: LeEqU16> SaturatingCast<FixedU16<Frac>> for F128Bits
impl<Frac: LeEqU16> SaturatingCast<FixedU16<Frac>> for F128Bits
source§fn saturating_cast(self) -> FixedU16<Frac>
fn saturating_cast(self) -> FixedU16<Frac>
source§impl<Frac: LeEqU32> SaturatingCast<FixedU32<Frac>> for F128Bits
impl<Frac: LeEqU32> SaturatingCast<FixedU32<Frac>> for F128Bits
source§fn saturating_cast(self) -> FixedU32<Frac>
fn saturating_cast(self) -> FixedU32<Frac>
source§impl<Frac: LeEqU64> SaturatingCast<FixedU64<Frac>> for F128Bits
impl<Frac: LeEqU64> SaturatingCast<FixedU64<Frac>> for F128Bits
source§fn saturating_cast(self) -> FixedU64<Frac>
fn saturating_cast(self) -> FixedU64<Frac>
source§impl<Frac: LeEqU8> SaturatingCast<FixedU8<Frac>> for F128Bits
impl<Frac: LeEqU8> SaturatingCast<FixedU8<Frac>> for F128Bits
source§fn saturating_cast(self) -> FixedU8<Frac>
fn saturating_cast(self) -> FixedU8<Frac>
source§impl ToFixed for F128Bits
impl ToFixed for F128Bits
source§fn to_fixed<F: Fixed>(self) -> F
fn to_fixed<F: Fixed>(self) -> F
Converts a floating-point number to a fixed-point number.
Rounding is to the nearest, with ties rounded to even.
§Panics
Panics if self
is not finite.
When debug assertions are enabled, also panics if the value does not
fit. When debug assertions are not enabled, the wrapped value can be
returned, but it is not considered a breaking change if in the future
it panics; if wrapping is required use wrapping_to_fixed
instead.
source§fn checked_to_fixed<F: Fixed>(self) -> Option<F>
fn checked_to_fixed<F: Fixed>(self) -> Option<F>
Converts a floating-point number to a fixed-point
number if it fits, otherwise returns None
.
Rounding is to the nearest, with ties rounded to even.