Skip to main content

FloatConst

Trait FloatConst 

Source
pub trait FloatConst {
    const HALF: Self;
    const E: Self;
    const PI: Self;
    const THREE: Self;
    const TWOPI: Self;
    const FOURPI: Self;
    const POINT_TWO: Self;
    const FRAC_1_SQRT_2: Self;
}
Expand description

constant values for floating point data types

Required Associated Constants§

Source

const HALF: Self

0.5

Source

const E: Self

e

Source

const PI: Self

π

Source

const THREE: Self

3.0

Source

const TWOPI: Self

Source

const FOURPI: Self

Source

const POINT_TWO: Self

0.2

Source

const FRAC_1_SQRT_2: Self

1/√2

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

Source§

const HALF: Self = 0.5

Source§

const E: Self = f32::consts::E

Source§

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

Source§

const THREE: Self = 3.0

Source§

const TWOPI: Self

Source§

const FOURPI: Self

Source§

const POINT_TWO: Self = 0.2

Source§

const FRAC_1_SQRT_2: Self = f32::consts::FRAC_1_SQRT_2

Source§

impl FloatConst for f64

Source§

const HALF: Self = 0.5

Source§

const E: Self = std::f64::consts::E

Source§

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

Source§

const THREE: Self = 3.0

Source§

const TWOPI: Self

Source§

const FOURPI: Self

Source§

const POINT_TWO: Self = 0.2

Source§

const FRAC_1_SQRT_2: Self = std::f64::consts::FRAC_1_SQRT_2

Source§

impl FloatConst for bf16

Source§

const HALF: Self

Source§

const E: Self

Source§

const PI: Self

Source§

const THREE: Self

Source§

const TWOPI: Self

Source§

const FOURPI: Self

Source§

const POINT_TWO: Self

Source§

const FRAC_1_SQRT_2: Self

Source§

impl FloatConst for f16

Source§

const HALF: Self

Source§

const E: Self

Source§

const PI: Self

Source§

const THREE: Self

Source§

const TWOPI: Self

Source§

const FOURPI: Self

Source§

const POINT_TWO: Self

Source§

const FRAC_1_SQRT_2: Self

Implementors§