nalgebra

Trait RealField

Source
pub trait RealField:
    ComplexField<RealField = Self>
    + RelativeEq<Epsilon = Self, Epsilon = Self>
    + UlpsEq
    + Signed
    + PartialOrd {
Show 24 methods // Required methods fn is_sign_positive(&self) -> bool; fn is_sign_negative(&self) -> bool; fn copysign(self, sign: Self) -> Self; fn max(self, other: Self) -> Self; fn min(self, other: Self) -> Self; fn clamp(self, min: Self, max: Self) -> Self; fn atan2(self, other: Self) -> Self; fn min_value() -> Option<Self>; fn max_value() -> Option<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.

Required Methods§

Source

fn is_sign_positive(&self) -> bool

Is the sign of this real number positive?

Source

fn is_sign_negative(&self) -> bool

Is the sign of this real number negative?

Source

fn copysign(self, sign: Self) -> Self

Copies the sign of sign to self.

  • Returns self.simd_abs() if sign is positive or positive-zero.
  • Returns -self.simd_abs() if sign is negative or negative-zero.
Source

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

Source

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

Source

fn clamp(self, min: Self, max: Self) -> Self

Source

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

Source

fn min_value() -> Option<Self>

The smallest finite positive value representable using this type.

Source

fn max_value() -> Option<Self>

The largest finite positive value representable using this type.

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 min_value() -> Option<f32>

The smallest finite positive value representable using this type.

Source§

fn max_value() -> Option<f32>

The largest finite positive value representable using this type.

Source§

fn pi() -> f32

Archimedes’ constant.

Source§

fn two_pi() -> f32

2.0 * pi.

Source§

fn frac_pi_2() -> f32

pi / 2.0.

Source§

fn frac_pi_3() -> f32

pi / 3.0.

Source§

fn frac_pi_4() -> f32

pi / 4.0.

Source§

fn frac_pi_6() -> f32

pi / 6.0.

Source§

fn frac_pi_8() -> f32

pi / 8.0.

Source§

fn frac_1_pi() -> f32

1.0 / pi.

Source§

fn frac_2_pi() -> f32

2.0 / pi.

Source§

fn frac_2_sqrt_pi() -> f32

2.0 / sqrt(pi).

Source§

fn e() -> f32

Euler’s number.

Source§

fn log2_e() -> f32

log2(e).

Source§

fn log10_e() -> f32

log10(e).

Source§

fn ln_2() -> f32

ln(2.0).

Source§

fn ln_10() -> f32

ln(10.0).

Source§

fn is_sign_positive(&self) -> bool

Source§

fn is_sign_negative(&self) -> bool

Source§

fn copysign(self, sign: f32) -> f32

Source§

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

Source§

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

Source§

fn clamp(self, min: f32, max: f32) -> f32

Source§

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

Source§

impl RealField for f64

Source§

fn min_value() -> Option<f64>

The smallest finite positive value representable using this type.

Source§

fn max_value() -> Option<f64>

The largest finite positive value representable using this type.

Source§

fn pi() -> f64

Archimedes’ constant.

Source§

fn two_pi() -> f64

2.0 * pi.

Source§

fn frac_pi_2() -> f64

pi / 2.0.

Source§

fn frac_pi_3() -> f64

pi / 3.0.

Source§

fn frac_pi_4() -> f64

pi / 4.0.

Source§

fn frac_pi_6() -> f64

pi / 6.0.

Source§

fn frac_pi_8() -> f64

pi / 8.0.

Source§

fn frac_1_pi() -> f64

1.0 / pi.

Source§

fn frac_2_pi() -> f64

2.0 / pi.

Source§

fn frac_2_sqrt_pi() -> f64

2.0 / sqrt(pi).

Source§

fn e() -> f64

Euler’s number.

Source§

fn log2_e() -> f64

log2(e).

Source§

fn log10_e() -> f64

log10(e).

Source§

fn ln_2() -> f64

ln(2.0).

Source§

fn ln_10() -> f64

ln(10.0).

Source§

fn is_sign_positive(&self) -> bool

Source§

fn is_sign_negative(&self) -> bool

Source§

fn copysign(self, sign: f64) -> f64

Source§

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

Source§

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

Source§

fn clamp(self, min: f64, max: f64) -> f64

Source§

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

Implementors§