Struct font_types::F2Dot14
source · pub struct F2Dot14(_);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) -> Self
pub const fn from_bits(bits: i16) -> 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 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; 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<F2Dot14> for F2Dot14
impl AddAssign<F2Dot14> for F2Dot14
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moresource§impl Ord for F2Dot14
impl Ord for F2Dot14
source§impl PartialEq<F2Dot14> for F2Dot14
impl PartialEq<F2Dot14> for F2Dot14
source§impl PartialOrd<F2Dot14> for F2Dot14
impl PartialOrd<F2Dot14> for F2Dot14
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl SubAssign<F2Dot14> for F2Dot14
impl SubAssign<F2Dot14> for F2Dot14
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-= operation. Read more