Skip to main content

Float

Trait Float 

Source
pub trait Float: Primitive + Float {
    const MIN: Self;
    const MAX: Self;
    const ZERO: Self;
    const ONE: Self;
    const TWO: Self;
    const EPS: Self;

    // Provided method
    fn safe_clamp(self, min: Self, max: Self) -> Self { ... }
}

Required Associated Constants§

Source

const MIN: Self

Source

const MAX: Self

Source

const ZERO: Self

Source

const ONE: Self

Source

const TWO: Self

Source

const EPS: Self

Provided Methods§

Source

fn safe_clamp(self, min: Self, max: Self) -> Self

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

Source§

const MIN: Self = f32::MIN

Source§

const MAX: Self = f32::MAX

Source§

const ZERO: Self = 0.0

Source§

const ONE: Self = 1.0

Source§

const TWO: Self = 2.0

Source§

const EPS: Self = 1e-6_f32

Source§

impl Float for f64

Source§

const MIN: Self = f64::MIN

Source§

const MAX: Self = f64::MAX

Source§

const ZERO: Self = 0.0

Source§

const ONE: Self = 1.0

Source§

const TWO: Self = 2.0

Source§

const EPS: Self = 1e-12_f64

Implementors§