pub struct NumericalPrecision;Expand description
Numerical precision utilities
Implementations§
Source§impl NumericalPrecision
impl NumericalPrecision
Sourcepub fn is_zero<T: Float>(value: T, eps: Option<T>) -> bool
pub fn is_zero<T: Float>(value: T, eps: Option<T>) -> bool
Check if a value is effectively zero (within epsilon tolerance)
Sourcepub fn approx_eq<T: Float>(a: T, b: T, eps: Option<T>) -> bool
pub fn approx_eq<T: Float>(a: T, b: T, eps: Option<T>) -> bool
Check if two values are approximately equal
Auto Trait Implementations§
impl Freeze for NumericalPrecision
impl RefUnwindSafe for NumericalPrecision
impl Send for NumericalPrecision
impl Sync for NumericalPrecision
impl Unpin for NumericalPrecision
impl UnwindSafe for NumericalPrecision
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
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 more