num_traits::float

Trait FloatConst

source
pub trait FloatConst {
Show 19 methods // Required methods fn E() -> Self; fn FRAC_1_PI() -> Self; fn FRAC_1_SQRT_2() -> Self; fn FRAC_2_PI() -> Self; fn FRAC_2_SQRT_PI() -> Self; fn FRAC_PI_2() -> Self; fn FRAC_PI_3() -> Self; fn FRAC_PI_4() -> Self; fn FRAC_PI_6() -> Self; fn FRAC_PI_8() -> Self; fn LN_10() -> Self; fn LN_2() -> Self; fn LOG10_E() -> Self; fn LOG2_E() -> Self; fn PI() -> Self; fn SQRT_2() -> Self; // Provided methods fn TAU() -> Self where Self: Sized + Add<Self, Output = Self> { ... } fn LOG10_2() -> Self where Self: Sized + Div<Self, Output = Self> { ... } fn LOG2_10() -> Self where Self: Sized + Div<Self, Output = Self> { ... }
}

Required Methods§

source

fn E() -> Self

Return Euler’s number.

source

fn FRAC_1_PI() -> Self

Return 1.0 / π.

source

fn FRAC_1_SQRT_2() -> Self

Return 1.0 / sqrt(2.0).

source

fn FRAC_2_PI() -> Self

Return 2.0 / π.

source

fn FRAC_2_SQRT_PI() -> Self

Return 2.0 / sqrt(π).

source

fn FRAC_PI_2() -> Self

Return π / 2.0.

source

fn FRAC_PI_3() -> Self

Return π / 3.0.

source

fn FRAC_PI_4() -> Self

Return π / 4.0.

source

fn FRAC_PI_6() -> Self

Return π / 6.0.

source

fn FRAC_PI_8() -> Self

Return π / 8.0.

source

fn LN_10() -> Self

Return ln(10.0).

source

fn LN_2() -> Self

Return ln(2.0).

source

fn LOG10_E() -> Self

Return log10(e).

source

fn LOG2_E() -> Self

Return log2(e).

source

fn PI() -> Self

Return Archimedes’ constant π.

source

fn SQRT_2() -> Self

Return sqrt(2.0).

Provided Methods§

source

fn TAU() -> Self
where Self: Sized + Add<Self, Output = Self>,

Return the full circle constant τ.

source

fn LOG10_2() -> Self
where Self: Sized + Div<Self, Output = Self>,

Return log10(2.0).

source

fn LOG2_10() -> Self
where Self: Sized + Div<Self, Output = Self>,

Return log2(10.0).

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FloatConst for f32

source§

fn E() -> Self

source§

fn FRAC_1_PI() -> Self

source§

fn FRAC_1_SQRT_2() -> Self

source§

fn FRAC_2_PI() -> Self

source§

fn FRAC_2_SQRT_PI() -> Self

source§

fn FRAC_PI_2() -> Self

source§

fn FRAC_PI_3() -> Self

source§

fn FRAC_PI_4() -> Self

source§

fn FRAC_PI_6() -> Self

source§

fn FRAC_PI_8() -> Self

source§

fn LN_10() -> Self

source§

fn LN_2() -> Self

source§

fn LOG10_E() -> Self

source§

fn LOG2_E() -> Self

source§

fn PI() -> Self

source§

fn SQRT_2() -> Self

source§

fn TAU() -> Self

source§

fn LOG10_2() -> Self

source§

fn LOG2_10() -> Self

source§

impl FloatConst for f64

source§

fn E() -> Self

source§

fn FRAC_1_PI() -> Self

source§

fn FRAC_1_SQRT_2() -> Self

source§

fn FRAC_2_PI() -> Self

source§

fn FRAC_2_SQRT_PI() -> Self

source§

fn FRAC_PI_2() -> Self

source§

fn FRAC_PI_3() -> Self

source§

fn FRAC_PI_4() -> Self

source§

fn FRAC_PI_6() -> Self

source§

fn FRAC_PI_8() -> Self

source§

fn LN_10() -> Self

source§

fn LN_2() -> Self

source§

fn LOG10_E() -> Self

source§

fn LOG2_E() -> Self

source§

fn PI() -> Self

source§

fn SQRT_2() -> Self

source§

fn TAU() -> Self

source§

fn LOG10_2() -> Self

source§

fn LOG2_10() -> Self

Implementors§