pub trait Real:
Num
+ Signed
+ Div<Output = Self>
+ Rem<Output = Self>
+ PartialOrd {
Show 46 methods
// Required methods
fn from_f64(v: f64) -> Self;
fn to_f64(self) -> f64;
fn sqrt(self) -> Self;
fn cbrt(self) -> Self;
fn powf(self, e: Self) -> Self;
fn powi(self, e: i32) -> Self;
fn exp(self) -> Self;
fn exp_m1(self) -> Self;
fn ln(self) -> Self;
fn ln_1p(self) -> Self;
fn log(self, base: Self) -> Self;
fn log10(self) -> Self;
fn log2(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 sinh(self) -> Self;
fn cosh(self) -> Self;
fn tanh(self) -> Self;
fn asinh(self) -> Self;
fn acosh(self) -> Self;
fn atanh(self) -> Self;
fn sin_cos(self) -> (Self, Self);
fn hypot(self, other: Self) -> Self;
fn copysign(self, other: Self) -> Self;
fn abs_sub(self, other: Self) -> Self;
fn recip(self) -> Self;
fn floor(self) -> Self;
fn ceil(self) -> Self;
fn round(self) -> Self;
fn trunc(self) -> Self;
fn fract(self) -> Self;
fn min(self, other: Self) -> Self;
fn max(self, other: Self) -> Self;
fn is_finite(self) -> bool;
fn is_nan(self) -> bool;
fn is_infinite(self) -> bool;
fn is_normal(self) -> bool;
fn is_subnormal(self) -> bool;
fn is_sign_negative(self) -> bool;
fn is_sign_positive(self) -> bool;
fn signum(self) -> Self;
}Expand description
Real numbers: transcendental functions, powers, rounding, classification.
Implemented for f32 and f64. Functions take radians unless a *_deg
variant exists.
Required Methods§
Sourcefn is_infinite(self) -> bool
fn is_infinite(self) -> bool
Returns true if self is positive or negative infinity.
Sourcefn is_subnormal(self) -> bool
fn is_subnormal(self) -> bool
Returns true if self is subnormal (denormal).
Sourcefn is_sign_negative(self) -> bool
fn is_sign_negative(self) -> bool
Returns true if the sign bit is negative.
Sourcefn is_sign_positive(self) -> bool
fn is_sign_positive(self) -> bool
Returns true if the sign bit is positive (or zero).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".