Trait orml_traits::arithmetic::CheckedMul
source · pub trait CheckedMul: Sized + Mul<Self, Output = Self> {
// Required method
fn checked_mul(&self, v: &Self) -> Option<Self>;
}
Expand description
Performs multiplication that returns None
instead of wrapping around on underflow or
overflow.
Required Methods§
sourcefn checked_mul(&self, v: &Self) -> Option<Self>
fn checked_mul(&self, v: &Self) -> Option<Self>
Multiplies two numbers, checking for underflow or overflow. If underflow
or overflow happens, None
is returned.
Implementations on Foreign Types§
source§impl CheckedMul for PerU16
impl CheckedMul for PerU16
Note
CheckedMul will never fail for PerThings.
source§impl CheckedMul for Permill
impl CheckedMul for Permill
Note
CheckedMul will never fail for PerThings.
source§impl CheckedMul for FixedI64
impl CheckedMul for FixedI64
source§impl CheckedMul for FixedU64
impl CheckedMul for FixedU64
source§impl CheckedMul for FixedI128
impl CheckedMul for FixedI128
source§impl CheckedMul for Perquintill
impl CheckedMul for Perquintill
Note
CheckedMul will never fail for PerThings.
fn checked_mul(&self, rhs: &Perquintill) -> Option<Perquintill>
source§impl CheckedMul for Perbill
impl CheckedMul for Perbill
Note
CheckedMul will never fail for PerThings.
source§impl CheckedMul for Percent
impl CheckedMul for Percent
Note
CheckedMul will never fail for PerThings.