Trait Real
pub trait Real:
Copy
+ Debug
+ PartialOrd
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Div<Output = Self>
+ Neg<Output = Self>
+ AddAssign
+ SubAssign
+ MulAssign
+ Sum
+ 'static {
const ZERO: Self;
const ONE: Self;
const EPSILON: Self;
// Required methods
fn from_f64(x: f64) -> Self;
fn to_f64(self) -> f64;
fn abs(self) -> Self;
fn sqrt(self) -> Self;
fn recip(self) -> Self;
fn mul_add(self, a: Self, b: Self) -> Self;
fn is_finite(self) -> bool;
fn max(self, other: Self) -> Self;
fn min(self, other: Self) -> Self;
}Expand description
The scalar type of every container and factorization of the crate.
Implemented for f64; xingo-extprec implements it for its extended
types (trilha L2). A total order is required (pivot search and pivot
tests), so intervals are not Real (D-0080, Q2). See the module
documentation for the requirements (R1)–(R4).
Required Associated Constants§
const ZERO: Self
const ZERO: Self
The additive identity.
const ONE: Self
const ONE: Self
The multiplicative identity.
const EPSILON: Self
const EPSILON: Self
Machine epsilon of the type (2⁻⁵² for f64).
Required Methods§
fn abs(self) -> Self
fn abs(self) -> Self
|x|.
fn sqrt(self) -> Self
fn sqrt(self) -> Self
√x.
fn recip(self) -> Self
fn recip(self) -> Self
1 / x.
fn mul_add(self, a: Self, b: Self) -> Self
fn mul_add(self, a: Self, b: Self) -> Self
self · a + b with a single rounding where the type allows.
fn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
The larger of two values, with the NaN rule of f64::max.
fn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
The smaller of two values, with the NaN rule of f64::min.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".