Skip to main content

Float

Trait Float 

Source
pub trait Float:
    Primitive
    + Float
    + NumHash
    + NumOrd<Self> {
    const DTYPE: DataType;
    const THREE: Self;
    const FOUR: Self;
    const FIVE: Self;
    const SIX: Self;
    const EPS: Self;
    const NAN: Self;
    const TENTH: Self;
    const HUNDREDTH: Self;
    const THOUSANDTH: Self;
    const PI: Self;

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

Required Associated Constants§

Source

const DTYPE: DataType

Source

const THREE: Self

Source

const FOUR: Self

Source

const FIVE: Self

Source

const SIX: Self

Source

const EPS: Self

Source

const NAN: Self

Source

const TENTH: Self

Source

const HUNDREDTH: Self

Source

const THOUSANDTH: Self

Source

const PI: 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".

Implementations on Foreign Types§

Source§

impl Float for f32

Source§

const DTYPE: DataType = DataType::Float32

Source§

const THREE: Self = 3.0

Source§

const FOUR: Self = 4.0

Source§

const FIVE: Self = 5.0

Source§

const SIX: Self = 6.0

Source§

const NAN: Self = f32::NAN

Source§

const EPS: Self = 1e-6_f32

Source§

const TENTH: Self = 0.1

Source§

const HUNDREDTH: Self = 0.01

Source§

const THOUSANDTH: Self = 0.001

Source§

const PI: Self = std::f32::consts::PI

Source§

impl Float for f64

Source§

const DTYPE: DataType = DataType::Float64

Source§

const THREE: Self = 3.0

Source§

const FOUR: Self = 4.0

Source§

const FIVE: Self = 5.0

Source§

const SIX: Self = 6.0

Source§

const NAN: Self = f64::NAN

Source§

const EPS: Self = 1e-12_f64

Source§

const TENTH: Self = 0.1

Source§

const HUNDREDTH: Self = 0.01

Source§

const THOUSANDTH: Self = 0.001

Source§

const PI: Self = std::f64::consts::PI

Implementors§