StableComputation

Trait StableComputation 

Source
pub trait StableComputation: Float + Debug {
    // Required methods
    fn machine_epsilon() -> Self;
    fn safe_recip(self) -> Self;
    fn is_effectively_zero(self) -> bool;
}
Expand description

Trait for numerically stable computations

Required Methods§

Source

fn machine_epsilon() -> Self

Machine epsilon for this type

Source

fn safe_recip(self) -> Self

Safe reciprocal that handles near-zero values

Source

fn is_effectively_zero(self) -> bool

Check if the value is effectively zero (within epsilon)

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 StableComputation for f32

Source§

impl StableComputation for f64

Implementors§