pub struct FixedPoint { /* private fields */ }Expand description
A fixed-point number stored as a raw Q-format integer.
Profile-dependent size:
embedded(Q64.64): 16 bytes (i128)balanced(Q128.128): 32 bytes (I256)scientific(Q256.256): 64 bytes (I512)
Arithmetic is performed directly on the raw Q-format values. Transcendentals route through FASC at tier N+1.
Implementations§
Source§impl FixedPoint
impl FixedPoint
Sourcepub fn from_raw(raw: BinaryStorage) -> Self
pub fn from_raw(raw: BinaryStorage) -> Self
Create from raw Q-format storage.
Sourcepub fn raw(self) -> BinaryStorage
pub fn raw(self) -> BinaryStorage
Access the raw Q-format storage.
Sourcepub fn is_negative(self) -> bool
pub fn is_negative(self) -> bool
Check if negative.
Sourcepub fn from_f32(v: f32) -> Self
pub fn from_f32(v: f32) -> Self
Create from an f32 value.
Uses IEEE 754 bit extraction for exact conversion — no float arithmetic is performed internally. Panics on NaN or infinity.
Sourcepub fn from_f64(v: f64) -> Self
pub fn from_f64(v: f64) -> Self
Create from an f64 value.
Uses IEEE 754 bit extraction for exact conversion — no float arithmetic is performed internally. Panics on NaN or infinity.
Trait Implementations§
Source§impl Add for FixedPoint
impl Add for FixedPoint
Source§impl AddAssign for FixedPoint
impl AddAssign for FixedPoint
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl Clone for FixedPoint
impl Clone for FixedPoint
Source§fn clone(&self) -> FixedPoint
fn clone(&self) -> FixedPoint
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FixedPoint
impl Debug for FixedPoint
Source§impl Default for FixedPoint
impl Default for FixedPoint
Source§impl Display for FixedPoint
impl Display for FixedPoint
Source§impl Div for FixedPoint
impl Div for FixedPoint
Source§impl DivAssign for FixedPoint
impl DivAssign for FixedPoint
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/= operation. Read moreSource§impl Mul for FixedPoint
impl Mul for FixedPoint
Source§impl MulAssign for FixedPoint
impl MulAssign for FixedPoint
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moreSource§impl Neg for FixedPoint
impl Neg for FixedPoint
Source§impl Ord for FixedPoint
impl Ord for FixedPoint
Source§impl PartialEq for FixedPoint
impl PartialEq for FixedPoint
Source§impl PartialOrd for FixedPoint
impl PartialOrd for FixedPoint
Source§impl Sub for FixedPoint
impl Sub for FixedPoint
Source§impl SubAssign for FixedPoint
impl SubAssign for FixedPoint
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for FixedPoint
impl Eq for FixedPoint
Auto Trait Implementations§
impl Freeze for FixedPoint
impl RefUnwindSafe for FixedPoint
impl Send for FixedPoint
impl Sync for FixedPoint
impl Unpin for FixedPoint
impl UnsafeUnpin for FixedPoint
impl UnwindSafe for FixedPoint
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