pub struct FixedU64 { /* private fields */ }
Expand description
Fixed precision u64
- upper 32 bits is value, lower 32 bits are the fractional portion of the
value. Each fractional portion is 1/u32::MAX
~= 2.328306e-10
or 0.000_000_000_238_306
,
or about 238.3 pico
, and can accurately represent SI-prefixes milli/1e-3
, micro/1e-6
, and
nano/1e-9
. The whole portion can represent 0
-> u32::MAX
(4_294_967_295
)
Implementations§
Source§impl FixedU64
impl FixedU64
pub const fn from_parts(whole: u32, fracs: u32) -> Self
pub const fn from_raw_value(data: u64) -> Self
pub const fn trunc(&self) -> u32
pub const fn whole(&self) -> u32
pub const fn fract(&self) -> u32
pub const fn raw_value(&self) -> u64
pub fn as_f64(&self) -> f64
pub const fn is_zero(&self) -> bool
Trait Implementations§
Source§impl AddAssign<&FixedU64> for &mut FixedU64
impl AddAssign<&FixedU64> for &mut FixedU64
Source§fn add_assign(&mut self, rhs: &FixedU64)
fn add_assign(&mut self, rhs: &FixedU64)
Performs the
+=
operation. Read moreSource§impl AddAssign<&FixedU64> for FixedU64
impl AddAssign<&FixedU64> for FixedU64
Source§fn add_assign(&mut self, rhs: &FixedU64)
fn add_assign(&mut self, rhs: &FixedU64)
Performs the
+=
operation. Read moreSource§impl AddAssign<&mut FixedU64> for &mut FixedU64
impl AddAssign<&mut FixedU64> for &mut FixedU64
Source§fn add_assign(&mut self, rhs: &mut FixedU64)
fn add_assign(&mut self, rhs: &mut FixedU64)
Performs the
+=
operation. Read moreSource§impl AddAssign<&mut FixedU64> for FixedU64
impl AddAssign<&mut FixedU64> for FixedU64
Source§fn add_assign(&mut self, rhs: &mut FixedU64)
fn add_assign(&mut self, rhs: &mut FixedU64)
Performs the
+=
operation. Read moreSource§impl AddAssign<FixedU64> for &mut FixedU64
impl AddAssign<FixedU64> for &mut FixedU64
Source§fn add_assign(&mut self, rhs: FixedU64)
fn add_assign(&mut self, rhs: FixedU64)
Performs the
+=
operation. Read moreSource§impl AddAssign<f64> for &mut FixedU64
impl AddAssign<f64> for &mut FixedU64
Source§fn add_assign(&mut self, rhs: f64)
fn add_assign(&mut self, rhs: f64)
Performs the
+=
operation. Read moreSource§impl AddAssign<f64> for FixedU64
impl AddAssign<f64> for FixedU64
Source§fn add_assign(&mut self, rhs: f64)
fn add_assign(&mut self, rhs: f64)
Performs the
+=
operation. Read moreSource§impl AddAssign for FixedU64
impl AddAssign for FixedU64
Source§fn add_assign(&mut self, rhs: FixedU64)
fn add_assign(&mut self, rhs: FixedU64)
Performs the
+=
operation. Read moreSource§impl DivAssign for &mut FixedU64
impl DivAssign for &mut FixedU64
Source§fn div_assign(&mut self, rhs: &mut FixedU64)
fn div_assign(&mut self, rhs: &mut FixedU64)
Performs the
/=
operation. Read moreSource§impl DivAssign for FixedU64
impl DivAssign for FixedU64
Source§fn div_assign(&mut self, rhs: FixedU64)
fn div_assign(&mut self, rhs: FixedU64)
Performs the
/=
operation. Read moreSource§impl FloatExt for FixedU64
impl FloatExt for FixedU64
Source§fn exp(self) -> Self::Type
fn exp(self) -> Self::Type
Implementation of Exponential Function from NIST DTMF eq 4.2.19: <https://dlmf.nist.gov/4.2.E19>
Source§fn ln(self) -> Self::Type
fn ln(self) -> Self::Type
Implementation of Natural Logarithm using NIST DLMF eq 4.6.4: <https://dlmf.nist.gov/4.6.E4>
Source§fn powf(self, a: Self::Type) -> Self::Type
fn powf(self, a: Self::Type) -> Self::Type
Implementation of general power function using NIST DLMF eq 4.2.26: <https://dlmf.nist.gov/4.2.E26>
type Type = FixedU64
type Size = u64
fn trunc(self) -> Self::Type
fn fract(self) -> Self::Type
fn abs(self) -> Self::Type
fn round(self) -> Self::Type
fn floor(self) -> Self::Type
fn ceil(self) -> Self::Type
fn signum(self) -> Self::Type
fn powi(self, val: i32) -> Self::Type
fn sqrt(self) -> Self::Type
fn to_bits(self) -> Self::Size
fn exponent(self) -> u16
fn significand(self) -> Self::Size
Source§impl MulAssign for &mut FixedU64
impl MulAssign for &mut FixedU64
Source§fn mul_assign(&mut self, rhs: &mut FixedU64)
fn mul_assign(&mut self, rhs: &mut FixedU64)
Performs the
*=
operation. Read moreSource§impl MulAssign for FixedU64
impl MulAssign for FixedU64
Source§fn mul_assign(&mut self, rhs: FixedU64)
fn mul_assign(&mut self, rhs: FixedU64)
Performs the
*=
operation. Read moreSource§impl Ord for FixedU64
impl Ord for FixedU64
Source§impl PartialOrd<FixedU64> for u16
impl PartialOrd<FixedU64> for u16
Source§impl PartialOrd<FixedU64> for u32
impl PartialOrd<FixedU64> for u32
Source§impl PartialOrd<FixedU64> for u8
impl PartialOrd<FixedU64> for u8
Source§impl PartialOrd<f64> for FixedU64
impl PartialOrd<f64> for FixedU64
Source§impl PartialOrd<u16> for FixedU64
impl PartialOrd<u16> for FixedU64
Source§impl PartialOrd<u32> for FixedU64
impl PartialOrd<u32> for FixedU64
Source§impl PartialOrd<u8> for FixedU64
impl PartialOrd<u8> for FixedU64
Source§impl PartialOrd for FixedU64
impl PartialOrd for FixedU64
Source§impl SubAssign<&FixedU64> for &mut FixedU64
impl SubAssign<&FixedU64> for &mut FixedU64
Source§fn sub_assign(&mut self, rhs: &FixedU64)
fn sub_assign(&mut self, rhs: &FixedU64)
Performs the
-=
operation. Read moreSource§impl SubAssign<&FixedU64> for FixedU64
impl SubAssign<&FixedU64> for FixedU64
Source§fn sub_assign(&mut self, rhs: &FixedU64)
fn sub_assign(&mut self, rhs: &FixedU64)
Performs the
-=
operation. Read moreSource§impl SubAssign<&mut FixedU64> for &mut FixedU64
impl SubAssign<&mut FixedU64> for &mut FixedU64
Source§fn sub_assign(&mut self, rhs: &mut FixedU64)
fn sub_assign(&mut self, rhs: &mut FixedU64)
Performs the
-=
operation. Read moreSource§impl SubAssign<&mut FixedU64> for FixedU64
impl SubAssign<&mut FixedU64> for FixedU64
Source§fn sub_assign(&mut self, rhs: &mut FixedU64)
fn sub_assign(&mut self, rhs: &mut FixedU64)
Performs the
-=
operation. Read moreSource§impl SubAssign<FixedU64> for &mut FixedU64
impl SubAssign<FixedU64> for &mut FixedU64
Source§fn sub_assign(&mut self, rhs: FixedU64)
fn sub_assign(&mut self, rhs: FixedU64)
Performs the
-=
operation. Read moreSource§impl SubAssign for FixedU64
impl SubAssign for FixedU64
Source§fn sub_assign(&mut self, rhs: FixedU64)
fn sub_assign(&mut self, rhs: FixedU64)
Performs the
-=
operation. Read moreimpl Copy for FixedU64
impl Eq for FixedU64
impl StructuralPartialEq for FixedU64
Auto Trait Implementations§
impl Freeze for FixedU64
impl RefUnwindSafe for FixedU64
impl Send for FixedU64
impl Sync for FixedU64
impl Unpin for FixedU64
impl UnwindSafe for FixedU64
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