Struct swiss_army_knife::fixed_point_arithmetic::Signed3232FixedPoint [−][src]
#[repr(C)]pub struct Signed3232FixedPoint(_);
Expand description
A Q-format Q32.32
signed fixed point number, viz:-
- Integer component is signed and 32 bits (
i32
). - Fraction component is 32 bits.
See upstream library https://github.com/PetteriAimonen/libfixmath
for example code to implement trigonometric functions.
Implementations
Inclusive minimum.
Inclusive maximum.
Computes the absolute value of self.
The absolute value of Self::InclusiveMinimum
cannot be represented without a sign, and attempting to calculate it will cause an overflow.
This means that code in debug mode will trigger a panic on this case and optimized code will return Self::InclusiveMinimum
without a panic.
Returns true if self is positive and false if the number is zero or negative.
Returns true if self is negative and false if the number is zero or positive.
Returns a number representing sign of self.
0
if the number is zero.1
if the number is positive.-1
if the number is negative.
Saturating addition.
Saturating subtraction.
Checked addition.
Checked subtraction.
Trait Implementations
Performs the +=
operation. Read more
Returns the “default value” for a type. Read more
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
Performs the conversion.
Performs the conversion.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Performs the %=
operation. Read more
Performs the -=
operation. Read more
type Error = ParseNumberError
type Error = ParseNumberError
The type returned in the event of a conversion error.
Performs the conversion.
type Error = ParseNumberError
type Error = ParseNumberError
The type returned in the event of a conversion error.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Signed3232FixedPoint
impl Send for Signed3232FixedPoint
impl Sync for Signed3232FixedPoint
impl Unpin for Signed3232FixedPoint
impl UnwindSafe for Signed3232FixedPoint
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> CallHasher for T where
T: Hash,
impl<T> CallHasher for T where
T: Hash,