pub trait RealField: ComplexField<RealField = Self> + RelativeEq<Self, Epsilon = Self, Epsilon = Self> + UlpsEq<Self> + Signed + PartialOrd<Self> {
Show 24 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§
sourcefn is_sign_positive(&self) -> bool
fn is_sign_positive(&self) -> bool
Is the sign of this real number positive?
sourcefn is_sign_negative(&self) -> bool
fn is_sign_negative(&self) -> bool
Is the sign of this real number negative?
sourcefn copysign(self, sign: Self) -> Self
fn copysign(self, sign: Self) -> Self
Copies the sign of sign
to self
.
- Returns
self.simd_abs()
ifsign
is positive or positive-zero. - Returns
-self.simd_abs()
ifsign
is negative or negative-zero.
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
sourcefn min_value() -> Option<Self>
fn min_value() -> Option<Self>
The smallest finite positive value representable using this type.
sourcefn max_value() -> Option<Self>
fn max_value() -> Option<Self>
The largest finite positive value representable using this type.
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
Implementations on Foreign Types§
source§impl RealField for f32
impl RealField for f32
source§fn min_value() -> Option<f32>
fn min_value() -> Option<f32>
The smallest finite positive value representable using this type.
source§fn max_value() -> Option<f32>
fn max_value() -> Option<f32>
The largest finite positive value representable using this type.
source§fn frac_2_sqrt_pi() -> f32
fn frac_2_sqrt_pi() -> f32
2.0 / sqrt(pi).
fn is_sign_positive(&self) -> bool
fn is_sign_negative(&self) -> bool
fn copysign(self, sign: f32) -> f32
fn max(self, other: f32) -> f32
fn min(self, other: f32) -> f32
fn clamp(self, min: f32, max: f32) -> f32
fn atan2(self, other: f32) -> f32
source§impl RealField for f64
impl RealField for f64
source§fn min_value() -> Option<f64>
fn min_value() -> Option<f64>
The smallest finite positive value representable using this type.
source§fn max_value() -> Option<f64>
fn max_value() -> Option<f64>
The largest finite positive value representable using this type.
source§fn frac_2_sqrt_pi() -> f64
fn frac_2_sqrt_pi() -> f64
2.0 / sqrt(pi).