pub trait RealField: ComplexField<RealField = Self> + RelativeEq<Self, Epsilon = Self, Epsilon = Self> + UlpsEq<Self> + Signed + Bounded + PartialOrd<Self> {
Show 22 methods
fn is_sign_positive(self) -> bool;
fn is_sign_negative(self) -> bool;
fn copysign(self, to: 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 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
fn is_sign_positive(self) -> bool
fn is_sign_positive(self) -> bool
Is the sign of this real number positive?
fn is_sign_negative(self) -> bool
fn is_sign_negative(self) -> bool
Is the sign of this real number negative?
Copies the sign of self
to to
.
- Returns
to.simd_abs()
ifself
is positive or positive-zero. - Returns
-to.simd_abs()
ifself
is negative or negative-zero.
fn frac_2_sqrt_pi() -> Self
Implementations on Foreign Types
sourceimpl RealField for f32
impl RealField for f32
sourcepub fn frac_2_sqrt_pi() -> f32
pub fn frac_2_sqrt_pi() -> f32
2.0 / sqrt(pi).
pub fn is_sign_positive(self) -> bool
pub fn is_sign_negative(self) -> bool
pub fn copysign(self, sign: f32) -> f32
pub fn max(self, other: f32) -> f32
pub fn min(self, other: f32) -> f32
pub fn clamp(self, min: f32, max: f32) -> f32
pub fn atan2(self, other: f32) -> f32
sourceimpl RealField for f64
impl RealField for f64
sourcepub fn frac_2_sqrt_pi() -> f64
pub fn frac_2_sqrt_pi() -> f64
2.0 / sqrt(pi).