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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FloatConst for f32

Source§

const HALF: Self = 0.5f32

Source§

const E: Self = 2.71828175f32

Source§

const PI: Self = 3.14159274f32

Source§

const THREE: Self = 3f32

Source§

const TWOPI: Self = 6.28318548f32

Source§

const FOURPI: Self = 12.566371f32

Source§

const POINT_TWO: Self = 0.200000003f32

Source§

const FRAC_1_SQRT_2: Self = 0.707106769f32

Source§

impl FloatConst for f64

Source§

const HALF: Self = 0.5f64

Source§

const E: Self = 2.7182818284590451f64

Source§

const PI: Self = 3.1415926535897931f64

Source§

const THREE: Self = 3f64

Source§

const TWOPI: Self = 6.2831853071795862f64

Source§

const FOURPI: Self = 12.566370614359172f64

Source§

const POINT_TWO: Self = 0.20000000000000001f64

Source§

const FRAC_1_SQRT_2: Self = 0.70710678118654757f64

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§