pub struct DoubleF64 {
pub hi: f64,
pub lo: f64,
}Expand description
A double-precision floating-point number: hi + lo with |lo| ≤ 0.5·ulp(hi).
Provides ~31 decimal digits (~84 binary bits) of precision.
Fields§
§hi: f64High-order component (the “main” value).
lo: f64Low-order component (the error term).
Implementations§
Source§impl DoubleF64
impl DoubleF64
Sourcepub fn new(hi: f64, lo: f64) -> DoubleF64
pub fn new(hi: f64, lo: f64) -> DoubleF64
Create a new DoubleF64 from high and low components.
The caller must ensure |lo| ≤ 0.5·ulp(hi) for correct results.
Sourcepub fn quick_two_sum(a: f64, b: f64) -> DoubleF64
pub fn quick_two_sum(a: f64, b: f64) -> DoubleF64
Create from two f64 values, normalizing via TwoSum.
Sourcepub fn two_sum(a: f64, b: f64) -> DoubleF64
pub fn two_sum(a: f64, b: f64) -> DoubleF64
Dekker’s TwoSum: error-free sum with rounding error captured.
Sourcepub fn is_infinite(self) -> bool
pub fn is_infinite(self) -> bool
Check if the value is infinite.
Trait Implementations§
Source§impl AddAssign for DoubleF64
impl AddAssign for DoubleF64
Source§fn add_assign(&mut self, other: DoubleF64)
fn add_assign(&mut self, other: DoubleF64)
Performs the
+= operation. Read moreimpl Copy for DoubleF64
Source§impl DivAssign for DoubleF64
impl DivAssign for DoubleF64
Source§fn div_assign(&mut self, other: DoubleF64)
fn div_assign(&mut self, other: DoubleF64)
Performs the
/= operation. Read moreimpl Eq for DoubleF64
Source§impl EvaluationDomain for DoubleF64
impl EvaluationDomain for DoubleF64
Source§fn powi_ref(&self, exp: i64) -> DoubleF64
fn powi_ref(&self, exp: i64) -> DoubleF64
self^exp for integer exponents. Returns 1 when exp == 0.Source§fn resolve_builtin(
name: &str,
arg: &DoubleF64,
) -> Result<DoubleF64, EvaluationError>
fn resolve_builtin( name: &str, arg: &DoubleF64, ) -> Result<DoubleF64, EvaluationError>
Resolve a built-in mathematical function. Read more
Source§impl MulAssign for DoubleF64
impl MulAssign for DoubleF64
Source§fn mul_assign(&mut self, other: DoubleF64)
fn mul_assign(&mut self, other: DoubleF64)
Performs the
*= operation. Read moreSource§impl PartialOrd for DoubleF64
impl PartialOrd for DoubleF64
Source§impl PowfExtension for DoubleF64
impl PowfExtension for DoubleF64
impl StructuralPartialEq for DoubleF64
Auto Trait Implementations§
impl Freeze for DoubleF64
impl RefUnwindSafe for DoubleF64
impl Send for DoubleF64
impl Sync for DoubleF64
impl Unpin for DoubleF64
impl UnsafeUnpin for DoubleF64
impl UnwindSafe for DoubleF64
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, Right> ClosedAdd<Right> for T
impl<T, Right> ClosedDiv<Right> for T
impl<T, Right> ClosedMul<Right> for T
impl<T> ClosedNeg for Twhere
T: Neg<Output = T>,
impl<T, Right> ClosedSub<Right> for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.