Float64Ext

Trait Float64Ext 

Source
pub trait Float64Ext:
    Sized
    + Sub<f64, Output = f64>
    + Copy
    + PartialOrd<f64> {
    // Required method
    fn is_nearly_zero_within_tolerance(&self, tolerance: f64) -> bool;

    // Provided methods
    fn is_nearly_zero(&self) -> bool { ... }
    fn is_nearly_equal(&self, other: f64) -> bool { ... }
    fn is_nearly_less_or_equal(&self, other: f64) -> bool { ... }
    fn is_nearly_greater_or_equal(&self, other: f64) -> bool { ... }
}
Expand description

A number of useful methods for f64 numbers.

Required Methods§

Source

fn is_nearly_zero_within_tolerance(&self, tolerance: f64) -> bool

Whether the number is approximately 0, with a given tolerance.

Provided Methods§

Source

fn is_nearly_zero(&self) -> bool

Whether the number is approximately 0.

Source

fn is_nearly_equal(&self, other: f64) -> bool

Whether the number is nearly equal to another number.

Source

fn is_nearly_less_or_equal(&self, other: f64) -> bool

Whether the number is nearly equal to another number.

Source

fn is_nearly_greater_or_equal(&self, other: f64) -> 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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Float64Ext for f64

Implementors§