pub struct F2Dot14(/* private fields */);Expand description
16-bit signed fixed point number with 14 bits of fraction.
Implementations§
Source§impl F2Dot14
impl F2Dot14
Sourcepub const fn from_bits(bits: i16) -> F2Dot14
pub const fn from_bits(bits: i16) -> F2Dot14
Creates a new fixed point value from the underlying bit representation.
Sourcepub const fn floor(self) -> F2Dot14
pub const fn floor(self) -> F2Dot14
Returns the largest integer less than or equal to the number.
Sourcepub fn wrapping_add(self, other: F2Dot14) -> F2Dot14
pub fn wrapping_add(self, other: F2Dot14) -> F2Dot14
Wrapping addition.
Sourcepub const fn saturating_add(self, other: F2Dot14) -> F2Dot14
pub const fn saturating_add(self, other: F2Dot14) -> F2Dot14
Saturating addition.
Sourcepub fn checked_add(self, other: F2Dot14) -> Option<F2Dot14>
pub fn checked_add(self, other: F2Dot14) -> Option<F2Dot14>
Checked addition.
Sourcepub const fn wrapping_sub(self, other: F2Dot14) -> F2Dot14
pub const fn wrapping_sub(self, other: F2Dot14) -> F2Dot14
Wrapping substitution.
Sourcepub const fn saturating_sub(self, other: F2Dot14) -> F2Dot14
pub const fn saturating_sub(self, other: F2Dot14) -> F2Dot14
Saturating substitution.
Sourcepub const fn to_be_bytes(self) -> [u8; 2]
pub const fn to_be_bytes(self) -> [u8; 2]
The representation of this number as a big-endian byte array.
Trait Implementations§
Source§impl AddAssign for F2Dot14
impl AddAssign for F2Dot14
Source§fn add_assign(&mut self, other: F2Dot14)
fn add_assign(&mut self, other: F2Dot14)
Performs the
+= operation. Read moreimpl Copy for F2Dot14
impl Eq for F2Dot14
Source§impl Ord for F2Dot14
impl Ord for F2Dot14
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 F2Dot14
impl PartialOrd for F2Dot14
Source§impl Scalar for F2Dot14
impl Scalar for F2Dot14
impl StructuralPartialEq for F2Dot14
Auto Trait Implementations§
impl Freeze for F2Dot14
impl RefUnwindSafe for F2Dot14
impl Send for F2Dot14
impl Sync for F2Dot14
impl Unpin for F2Dot14
impl UnsafeUnpin for F2Dot14
impl UnwindSafe for F2Dot14
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FixedSize for Twhere
T: Scalar,
impl<T> FixedSize for Twhere
T: Scalar,
Source§const RAW_BYTE_LEN: usize
const RAW_BYTE_LEN: usize
The raw size of this type, in bytes. Read more