pub trait Float32Ext:
Sized
+ Sub<f32, Output = f32>
+ Copy
+ PartialOrd<f32> {
// Required method
fn is_nearly_zero_within_tolerance(&self, tolerance: f32) -> bool;
// Provided methods
fn is_nearly_zero(&self) -> bool { ... }
fn is_nearly_equal(&self, other: f32) -> bool { ... }
fn is_nearly_less_or_equal(&self, other: f32) -> bool { ... }
fn is_nearly_greater_or_equal(&self, other: f32) -> bool { ... }
}Expand description
A number of useful methods for f32 numbers.
Required Methods§
Sourcefn is_nearly_zero_within_tolerance(&self, tolerance: f32) -> bool
fn is_nearly_zero_within_tolerance(&self, tolerance: f32) -> bool
Whether the number is approximately 0, with a given tolerance.
Provided Methods§
Sourcefn is_nearly_zero(&self) -> bool
fn is_nearly_zero(&self) -> bool
Whether the number is approximately 0.
Sourcefn is_nearly_equal(&self, other: f32) -> bool
fn is_nearly_equal(&self, other: f32) -> bool
Whether the number is nearly equal to another number.
Sourcefn is_nearly_less_or_equal(&self, other: f32) -> bool
fn is_nearly_less_or_equal(&self, other: f32) -> bool
Whether the number is nearly equal to another number.
Sourcefn is_nearly_greater_or_equal(&self, other: f32) -> bool
fn is_nearly_greater_or_equal(&self, other: f32) -> bool
Whether the number is nearly equal to another number.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".