#[repr(C)]pub struct Unsigned3232FixedPoint(_);
Expand description
A Q-format Q32.32
unsigned fixed point number, viz:-
- Integer component is unsigned and 32 bits (
u32
). - Fraction component is 32 bits.
See upstream library https://github.com/PetteriAimonen/libfixmath
for example code to implement trigonometric functions.
Implementations
sourceimpl Unsigned3232FixedPoint
impl Unsigned3232FixedPoint
sourcepub const InclusiveMinimum: Self = Self::new(Self::SmallestInteger, 0x0000_0000)
pub const InclusiveMinimum: Self = Self::new(Self::SmallestInteger, 0x0000_0000)
Inclusive minimum.
sourcepub const InclusiveMaximum: Self = Self::new(Self::LargestInteger, 0xFFFF_FFFF)
pub const InclusiveMaximum: Self = Self::new(Self::LargestInteger, 0xFFFF_FFFF)
Inclusive maximum.
sourcepub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Saturating addition.
sourcepub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Saturating subtraction.
sourcepub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_add(self, rhs: Self) -> Option<Self>
Checked addition.
sourcepub fn checked_sub(self, rhs: Self) -> Option<Self>
pub fn checked_sub(self, rhs: Self) -> Option<Self>
Checked subtraction.
sourcepub fn saturating_mul_by_scalar(self, scalar: u32) -> Self
pub fn saturating_mul_by_scalar(self, scalar: u32) -> Self
Saturating multiply by a scalar.
sourcepub fn checked_mul_by_scalar(self, scalar: u32) -> Option<Self>
pub fn checked_mul_by_scalar(self, scalar: u32) -> Option<Self>
Checked multiply by a scalar.
sourcepub fn checked_div_by_scalar(self, scalar: u32) -> Option<Self>
pub fn checked_div_by_scalar(self, scalar: u32) -> Option<Self>
Checked divide by a scalar.
Trait Implementations
sourceimpl AddAssign<Unsigned3232FixedPoint> for Unsigned3232FixedPoint
impl AddAssign<Unsigned3232FixedPoint> for Unsigned3232FixedPoint
sourcefn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the +=
operation. Read more
sourceimpl Clone for Unsigned3232FixedPoint
impl Clone for Unsigned3232FixedPoint
sourcefn clone(&self) -> Unsigned3232FixedPoint
fn clone(&self) -> Unsigned3232FixedPoint
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Unsigned3232FixedPoint
impl Debug for Unsigned3232FixedPoint
sourceimpl Default for Unsigned3232FixedPoint
impl Default for Unsigned3232FixedPoint
sourcefn default() -> Unsigned3232FixedPoint
fn default() -> Unsigned3232FixedPoint
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for Unsigned3232FixedPoint
impl<'de> Deserialize<'de> for Unsigned3232FixedPoint
sourcefn 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
sourceimpl From<([u8; 4], [u8; 4])> for Unsigned3232FixedPoint
impl From<([u8; 4], [u8; 4])> for Unsigned3232FixedPoint
sourcefn from(value: (BigEndianU32, BigEndianU32)) -> Self
fn from(value: (BigEndianU32, BigEndianU32)) -> Self
Converts to this type from the input type.
sourceimpl From<u64> for Unsigned3232FixedPoint
impl From<u64> for Unsigned3232FixedPoint
sourceimpl Hash for Unsigned3232FixedPoint
impl Hash for Unsigned3232FixedPoint
sourceimpl Into<([u8; 4], [u8; 4])> for Unsigned3232FixedPoint
impl Into<([u8; 4], [u8; 4])> for Unsigned3232FixedPoint
sourcefn into(self) -> (BigEndianU32, BigEndianU32)
fn into(self) -> (BigEndianU32, BigEndianU32)
Converts this type into the (usually inferred) input type.
sourceimpl Into<u64> for Unsigned3232FixedPoint
impl Into<u64> for Unsigned3232FixedPoint
sourceimpl Ord for Unsigned3232FixedPoint
impl Ord for Unsigned3232FixedPoint
sourceimpl PartialOrd<Unsigned3232FixedPoint> for Unsigned3232FixedPoint
impl PartialOrd<Unsigned3232FixedPoint> for Unsigned3232FixedPoint
sourcefn partial_cmp(&self, rhs: &Self) -> Option<Ordering>
fn partial_cmp(&self, rhs: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl RemAssign<Unsigned3232FixedPoint> for Unsigned3232FixedPoint
impl RemAssign<Unsigned3232FixedPoint> for Unsigned3232FixedPoint
sourcefn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the %=
operation. Read more
sourceimpl Serialize for Unsigned3232FixedPoint
impl Serialize for Unsigned3232FixedPoint
sourceimpl SubAssign<Unsigned3232FixedPoint> for Unsigned3232FixedPoint
impl SubAssign<Unsigned3232FixedPoint> for Unsigned3232FixedPoint
sourcefn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the -=
operation. Read more
sourceimpl TryFrom<Signed3232FixedPoint> for Unsigned3232FixedPoint
impl TryFrom<Signed3232FixedPoint> for Unsigned3232FixedPoint
type Error = ParseNumberError
type Error = ParseNumberError
The type returned in the event of a conversion error.
sourcefn try_from(value: Signed3232FixedPoint) -> Result<Self, Self::Error>
fn try_from(value: Signed3232FixedPoint) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<Unsigned3232FixedPoint> for Signed3232FixedPoint
impl TryFrom<Unsigned3232FixedPoint> for Signed3232FixedPoint
type Error = ParseNumberError
type Error = ParseNumberError
The type returned in the event of a conversion error.
sourcefn try_from(value: Unsigned3232FixedPoint) -> Result<Self, Self::Error>
fn try_from(value: Unsigned3232FixedPoint) -> Result<Self, Self::Error>
Performs the conversion.
impl Copy for Unsigned3232FixedPoint
impl Eq for Unsigned3232FixedPoint
Auto Trait Implementations
impl RefUnwindSafe for Unsigned3232FixedPoint
impl Send for Unsigned3232FixedPoint
impl Sync for Unsigned3232FixedPoint
impl Unpin for Unsigned3232FixedPoint
impl UnwindSafe for Unsigned3232FixedPoint
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more