Trait SaturatingMul

Source
pub trait SaturatingMul<Rhs = Self> {
    type Output;

    // Required method
    const fn saturating_mul(self, rhs: Rhs) -> Self::Output;
}
Expand description

✅ Saturating multiplication. Clamps the result on overflow.

§Panics

This function never panics.

Required Associated Types§

Required Methods§

Source

const fn saturating_mul(self, rhs: Rhs) -> Self::Output

Implementors§

Source§

impl SaturatingMul for Dec19x19

§Tests

check! ( [Dec19x19::saturating_mul] {
    (Dec19x19::MAX - Dec19x19!(10), Dec19x19!(2)) => Dec19x19::MAX,
    (Dec19x19::MAX - Dec19x19!(10), Dec19x19!(-2)) => Dec19x19::MIN,
});