alga::general

Trait RealField

Source
pub trait RealField:
    ComplexField<RealField = Self>
    + RelativeEq<Epsilon = Self>
    + UlpsEq<Epsilon = Self>
    + Lattice
    + Signed
    + Bounded {
Show 20 methods // Required methods fn is_sign_positive(self) -> bool; fn is_sign_negative(self) -> bool; fn max(self, other: Self) -> Self; fn min(self, other: Self) -> Self; fn atan2(self, other: Self) -> Self; fn pi() -> Self; fn two_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 frac_1_pi() -> Self; fn frac_2_pi() -> Self; fn frac_2_sqrt_pi() -> Self; fn e() -> Self; fn log2_e() -> Self; fn log10_e() -> Self; fn ln_2() -> Self; fn ln_10() -> Self;
}
Expand description

Trait shared by all reals.

Reals are equipped with functions that are commonly used on reals. The results of those functions only have to be approximately equal to the actual theoretical values.

Required Methods§

Source

fn is_sign_positive(self) -> bool

Source

fn is_sign_negative(self) -> bool

Source

fn max(self, other: Self) -> Self

Source

fn min(self, other: Self) -> Self

Source

fn atan2(self, other: Self) -> Self

Source

fn pi() -> Self

Source

fn two_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 frac_1_pi() -> Self

Source

fn frac_2_pi() -> Self

Source

fn frac_2_sqrt_pi() -> Self

Source

fn e() -> Self

Source

fn log2_e() -> Self

Source

fn log10_e() -> Self

Source

fn ln_2() -> Self

Source

fn ln_10() -> Self

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

Source§

fn pi() -> Self

Archimedes’ constant.

Source§

fn two_pi() -> Self

2.0 * pi.

Source§

fn frac_pi_2() -> Self

pi / 2.0.

Source§

fn frac_pi_3() -> Self

pi / 3.0.

Source§

fn frac_pi_4() -> Self

pi / 4.0.

Source§

fn frac_pi_6() -> Self

pi / 6.0.

Source§

fn frac_pi_8() -> Self

pi / 8.0.

Source§

fn frac_1_pi() -> Self

1.0 / pi.

Source§

fn frac_2_pi() -> Self

2.0 / pi.

Source§

fn frac_2_sqrt_pi() -> Self

2.0 / sqrt(pi).

Source§

fn e() -> Self

Euler’s number.

Source§

fn log2_e() -> Self

log2(e).

Source§

fn log10_e() -> Self

log10(e).

Source§

fn ln_2() -> Self

ln(2.0).

Source§

fn ln_10() -> Self

ln(10.0).

Source§

fn is_sign_positive(self) -> bool

Source§

fn is_sign_negative(self) -> bool

Source§

fn max(self, other: Self) -> Self

Source§

fn min(self, other: Self) -> Self

Source§

fn atan2(self, other: Self) -> Self

Source§

impl RealField for f64

Source§

fn pi() -> Self

Archimedes’ constant.

Source§

fn two_pi() -> Self

2.0 * pi.

Source§

fn frac_pi_2() -> Self

pi / 2.0.

Source§

fn frac_pi_3() -> Self

pi / 3.0.

Source§

fn frac_pi_4() -> Self

pi / 4.0.

Source§

fn frac_pi_6() -> Self

pi / 6.0.

Source§

fn frac_pi_8() -> Self

pi / 8.0.

Source§

fn frac_1_pi() -> Self

1.0 / pi.

Source§

fn frac_2_pi() -> Self

2.0 / pi.

Source§

fn frac_2_sqrt_pi() -> Self

2.0 / sqrt(pi).

Source§

fn e() -> Self

Euler’s number.

Source§

fn log2_e() -> Self

log2(e).

Source§

fn log10_e() -> Self

log10(e).

Source§

fn ln_2() -> Self

ln(2.0).

Source§

fn ln_10() -> Self

ln(10.0).

Source§

fn is_sign_positive(self) -> bool

Source§

fn is_sign_negative(self) -> bool

Source§

fn max(self, other: Self) -> Self

Source§

fn min(self, other: Self) -> Self

Source§

fn atan2(self, other: Self) -> Self

Implementors§