pub struct ComparisonOptions {
pub epsilon: f32,
pub abs_th: f32,
}
Expand description
Options for configuring the floating-point comparison behavior.
Fields§
§epsilon: f32
The relative tolerance used for comparison (epsilon).
This is typically a small value like FLT_EPSILON
.
abs_th: f32
The absolute tolerance used for comparison. This is typically used for very small numbers.
Implementations§
Source§impl ComparisonOptions
impl ComparisonOptions
Sourcepub const fn new(epsilon: f32, abs_th: f32) -> Self
pub const fn new(epsilon: f32, abs_th: f32) -> Self
Creates a new ComparisonOptions
instance with default values.
The default values are epsilon = 128 * FLT_EPSILON
and abs_th = FLT_MIN
.
Sourcepub const fn const_default() -> Self
pub const fn const_default() -> Self
Returns default comparison options with typical values:
epsilon
: 128 * FLT_EPSILONabs_th
: FLT_MIN
Trait Implementations§
Source§impl Clone for ComparisonOptions
impl Clone for ComparisonOptions
Source§fn clone(&self) -> ComparisonOptions
fn clone(&self) -> ComparisonOptions
Returns a copy 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 ComparisonOptions
impl Debug for ComparisonOptions
Source§impl Default for ComparisonOptions
impl Default for ComparisonOptions
impl Copy for ComparisonOptions
Auto Trait Implementations§
impl Freeze for ComparisonOptions
impl RefUnwindSafe for ComparisonOptions
impl Send for ComparisonOptions
impl Sync for ComparisonOptions
impl Unpin for ComparisonOptions
impl UnwindSafe for ComparisonOptions
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