Skip to main content

MulAdd

Trait MulAdd 

Source
pub trait MulAdd {
    // Required method
    fn mul_add(self, b: &Self, c: &Self) -> Self;
}
Expand description

This trait provide the interface of the function for performing a multiplication and an addition in one fused operation.

§Note

The difference between this trait and num::traits::MulAdd is that this trait uses references as input arguments instead of values as used by the function num::traits::MulAdd::mul_add().

Required Methods§

Source

fn mul_add(self, b: &Self, c: &Self) -> Self

Multiplies and adds in one fused operation, rounding to the nearest with only one rounding error.

a.mul_add(b, c) produces a result like a * &b + &c.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl MulAdd for Complex<f64>

Implementation of the MulAdd trait for Complex<f64>.

Source§

fn mul_add(self, b: &Self, c: &Self) -> Self

Multiplies and adds in one fused operation, rounding to the nearest with only one rounding error.

a.mul_add(b, c) produces a result like a * &b + &c.

Source§

impl MulAdd for f64

Implementation of the MulAdd trait for f64.

Source§

fn mul_add(self, b: &Self, c: &Self) -> Self

Multiplies and adds in one fused operation, rounding to the nearest with only one rounding error.

a.mul_add(b, c) produces a result like a * &b + &c.

Implementors§