pub trait Real: 'static + SubsetOf<Self> + SupersetOf<f64> + Field<Output = Self> + Copy + Num + FromPrimitive + Neg + AddAssign<Self> + MulAssign<Self> + SubAssign<Self> + DivAssign<Self> + RelativeEq<Self, Epsilon = Self, Epsilon = Self> + UlpsEq<Self> + Lattice + PartialEq<Self> + Signed + Send + Sync + Any + Debug + Display + Bounded {
Show 55 methods
fn floor(self) -> Self;
fn ceil(self) -> Self;
fn round(self) -> Self;
fn trunc(self) -> Self;
fn fract(self) -> Self;
fn abs(self) -> Self;
fn signum(self) -> Self;
fn is_sign_positive(self) -> bool;
fn is_sign_negative(self) -> bool;
fn mul_add(self, a: Self, b: Self) -> Self;
fn recip(self) -> Self;
fn powi(self, n: i32) -> Self;
fn powf(self, n: Self) -> Self;
fn sqrt(self) -> Self;
fn exp(self) -> Self;
fn exp2(self) -> Self;
fn ln(self) -> Self;
fn log(self, base: Self) -> Self;
fn log2(self) -> Self;
fn log10(self) -> Self;
fn max(self, other: Self) -> Self;
fn min(self, other: Self) -> Self;
fn cbrt(self) -> Self;
fn hypot(self, other: Self) -> Self;
fn sin(self) -> Self;
fn cos(self) -> Self;
fn tan(self) -> Self;
fn asin(self) -> Self;
fn acos(self) -> Self;
fn atan(self) -> Self;
fn atan2(self, other: Self) -> Self;
fn sin_cos(self) -> (Self, Self);
fn exp_m1(self) -> Self;
fn ln_1p(self) -> Self;
fn sinh(self) -> Self;
fn cosh(self) -> Self;
fn tanh(self) -> Self;
fn asinh(self) -> Self;
fn acosh(self) -> Self;
fn atanh(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§
fn floor(self) -> Self
fn ceil(self) -> Self
fn round(self) -> Self
fn trunc(self) -> Self
fn fract(self) -> Self
fn abs(self) -> Self
fn signum(self) -> Self
fn is_sign_positive(self) -> bool
fn is_sign_negative(self) -> bool
fn mul_add(self, a: Self, b: Self) -> Self
fn recip(self) -> Self
fn powi(self, n: i32) -> Self
fn powf(self, n: Self) -> Self
fn sqrt(self) -> Self
fn exp(self) -> Self
fn exp2(self) -> Self
fn ln(self) -> Self
fn log(self, base: Self) -> Self
fn log2(self) -> Self
fn log10(self) -> Self
fn max(self, other: Self) -> Self
fn min(self, other: Self) -> Self
fn cbrt(self) -> Self
fn hypot(self, other: Self) -> Self
fn sin(self) -> Self
fn cos(self) -> Self
fn tan(self) -> Self
fn asin(self) -> Self
fn acos(self) -> Self
fn atan(self) -> Self
fn atan2(self, other: Self) -> Self
fn sin_cos(self) -> (Self, Self)
fn exp_m1(self) -> Self
fn ln_1p(self) -> Self
fn sinh(self) -> Self
fn cosh(self) -> Self
fn tanh(self) -> Self
fn asinh(self) -> Self
fn acosh(self) -> Self
fn atanh(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
Implementations on Foreign Types§
source§impl Real for f32
impl Real for f32
source§fn frac_2_sqrt_pi() -> f32
fn frac_2_sqrt_pi() -> f32
2.0 / sqrt(pi).
fn floor(self) -> f32
fn ceil(self) -> f32
fn round(self) -> f32
fn trunc(self) -> f32
fn fract(self) -> f32
fn abs(self) -> f32
fn signum(self) -> f32
fn is_sign_positive(self) -> bool
fn is_sign_negative(self) -> bool
fn mul_add(self, a: f32, b: f32) -> f32
fn recip(self) -> f32
fn powi(self, n: i32) -> f32
fn powf(self, n: f32) -> f32
fn sqrt(self) -> f32
fn exp(self) -> f32
fn exp2(self) -> f32
fn ln(self) -> f32
fn log(self, base: f32) -> f32
fn log2(self) -> f32
fn log10(self) -> f32
fn max(self, other: f32) -> f32
fn min(self, other: f32) -> f32
fn cbrt(self) -> f32
fn hypot(self, other: f32) -> f32
fn sin(self) -> f32
fn cos(self) -> f32
fn tan(self) -> f32
fn asin(self) -> f32
fn acos(self) -> f32
fn atan(self) -> f32
fn atan2(self, other: f32) -> f32
fn sin_cos(self) -> (f32, f32)
fn exp_m1(self) -> f32
fn ln_1p(self) -> f32
fn sinh(self) -> f32
fn cosh(self) -> f32
fn tanh(self) -> f32
fn asinh(self) -> f32
fn acosh(self) -> f32
fn atanh(self) -> f32
source§impl Real for f64
impl Real for f64
source§fn frac_2_sqrt_pi() -> f64
fn frac_2_sqrt_pi() -> f64
2.0 / sqrt(pi).