pub struct F48Dot16(/* private fields */);Expand description
64-bit signed fixed point number with 16 bits of fraction.
Implementations§
Source§impl F48Dot16
impl F48Dot16
Sourcepub const fn from_bits(bits: i64) -> Self
pub const fn from_bits(bits: i64) -> Self
Creates a new fixed point value from the underlying bit representation.
Sourcepub fn wrapping_add(self, other: Self) -> Self
pub fn wrapping_add(self, other: Self) -> Self
Wrapping addition.
Sourcepub const fn saturating_add(self, other: Self) -> Self
pub const fn saturating_add(self, other: Self) -> Self
Saturating addition.
Sourcepub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_add(self, other: Self) -> Option<Self>
Checked addition.
Sourcepub const fn wrapping_sub(self, other: Self) -> Self
pub const fn wrapping_sub(self, other: Self) -> Self
Wrapping substitution.
Sourcepub const fn saturating_sub(self, other: Self) -> Self
pub const fn saturating_sub(self, other: Self) -> Self
Saturating substitution.
Sourcepub const fn to_be_bytes(self) -> [u8; 8]
pub const fn to_be_bytes(self) -> [u8; 8]
The representation of this number as a big-endian byte array.
Source§impl F48Dot16
impl F48Dot16
Sourcepub const fn to_i64(self) -> i64
pub const fn to_i64(self) -> i64
Converts a 48.16 fixed point value to a 64 bit integer, rounding off the fractional bits.
Sourcepub const fn to_i32(self) -> i32
pub const fn to_i32(self) -> i32
Converts a 48.16 fixed point value to a 32 bit integer, rounding off the fractional bits.
This truncates the integral bits if the value is too large to fit.
Trait Implementations§
Source§impl AddAssign for F48Dot16
impl AddAssign for F48Dot16
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moreimpl AnyBitPattern for F48Dot16
Available on crate feature
bytemuck only.impl Copy for F48Dot16
Source§impl<'de> Deserialize<'de> for F48Dot16
Available on crate feature serde only.
impl<'de> Deserialize<'de> for F48Dot16
Available on crate feature
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for F48Dot16
impl NoUninit for F48Dot16
Available on crate feature
bytemuck only.Source§impl Ord for F48Dot16
impl Ord for F48Dot16
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for F48Dot16
impl PartialOrd for F48Dot16
impl StructuralPartialEq for F48Dot16
Auto Trait Implementations§
impl Freeze for F48Dot16
impl RefUnwindSafe for F48Dot16
impl Send for F48Dot16
impl Sync for F48Dot16
impl Unpin for F48Dot16
impl UnsafeUnpin for F48Dot16
impl UnwindSafe for F48Dot16
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.