Skip to main content

Float

Trait Float 

Source
pub trait Float: Copy + PartialOrd {
    const MIN: Self;
    const MAX: Self;

    // Required method
    fn to_f64(self) -> f64;
}
Expand description

Trait bound for float types usable with floats().

Required Associated Constants§

Source

const MIN: Self

The minimum value of this type.

Source

const MAX: Self

The maximum value of this type.

Required Methods§

Source

fn to_f64(self) -> f64

Widen to f64 for cross-width comparisons (bound validation).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Float for f32

Source§

const MIN: Self = f32::MIN

Source§

const MAX: Self = f32::MAX

Source§

fn to_f64(self) -> f64

Source§

impl Float for f64

Source§

const MIN: Self = f64::MIN

Source§

const MAX: Self = f64::MAX

Source§

fn to_f64(self) -> f64

Implementors§