pub trait Scalar: Copy + Clone + Debug + Zero + Add<Output = Self> + Sub<Output = Self> + Mul<Output = Self> + Div<Output = Self> + AddAssign + SubAssign + MulAssign + DivAssign + PartialOrd + PartialEq {
// Required methods
fn to_f32(self) -> f32;
fn from_f32(value: f32) -> Self;
// Provided methods
fn fma(a: Self, b: Self, c: Self) -> Self { ... }
fn fms(a: Self, b: Self, c: Self) -> Self { ... }
}
Expand description
A trait for types that act as scalars in mathematical operations, like real numbers or complex numbers. I concider a scalar, any struct which contains all the traits listed bellow. f32 is an example if the Scalar implementation. In the future a Complex Number struct implementation could potentially fit and allign with all the traits listed bellow.
Required Methods§
Provided Methods§
Object Safety§
This trait is not object safe.