pub trait Multiplication:
Addition
+ Mul<Output = Self>
+ MulAssign<Self>
+ Div<Self, Output = Self>
+ DivAssign<Self>
+ Rem<Self, Output = Self>
+ RemAssign<Self> {
const ONE: Self;
// Required methods
fn mul_add(self, a: Self, b: Self) -> Self;
fn mul_add_assign(&mut self, a: Self, b: Self);
fn powi(self, exp: i32) -> Self;
// Provided methods
fn half(self) -> Self { ... }
fn double(self) -> Self { ... }
fn inv(self) -> Self { ... }
}Expand description
The Multiplication trait provides the multiplicative identity and
operations for a Number type.
Required Associated Constants§
Required Methods§
Sourcefn mul_add(self, a: Self, b: Self) -> Self
fn mul_add(self, a: Self, b: Self) -> Self
Returns self + a * b, potentially as a fused multiply-add operation.
Sourcefn mul_add_assign(&mut self, a: Self, b: Self)
fn mul_add_assign(&mut self, a: Self, b: Self)
Replace self with self + a * b, potentially as a fused
multiply-add-assign operation.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".