Trait polkadot_sdk_frame::arithmetic::traits::CheckedMul
source · pub trait CheckedMul: Sized + Mul<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.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl CheckedMul for i8
impl CheckedMul for i8
source§impl CheckedMul for i16
impl CheckedMul for i16
source§impl CheckedMul for i32
impl CheckedMul for i32
source§impl CheckedMul for i64
impl CheckedMul for i64
source§impl CheckedMul for i128
impl CheckedMul for i128
source§impl CheckedMul for isize
impl CheckedMul for isize
source§impl CheckedMul for u8
impl CheckedMul for u8
source§impl CheckedMul for u16
impl CheckedMul for u16
source§impl CheckedMul for u32
impl CheckedMul for u32
source§impl CheckedMul for u64
impl CheckedMul for u64
source§impl CheckedMul for u128
impl CheckedMul for u128
source§impl CheckedMul for usize
impl CheckedMul for usize
source§impl CheckedMul for BigInt
impl CheckedMul for BigInt
source§impl CheckedMul for BigUint
impl CheckedMul for BigUint
§impl CheckedMul for U128
impl CheckedMul for U128
fn checked_mul(&self, v: &U128) -> Option<U128>
§impl CheckedMul for U128
impl CheckedMul for U128
fn checked_mul(&self, v: &U128) -> Option<U128>
§impl CheckedMul for U256
impl CheckedMul for U256
fn checked_mul(&self, v: &U256) -> Option<U256>
§impl CheckedMul for U512
impl CheckedMul for U512
fn checked_mul(&self, v: &U512) -> Option<U512>
source§impl<T> CheckedMul for Ratio<T>
impl<T> CheckedMul for Ratio<T>
§impl<T, D> CheckedMul for TypeWithDefault<T, D>where
T: CheckedMul,
D: Get<T>,
impl<T, D> CheckedMul for TypeWithDefault<T, D>where
T: CheckedMul,
D: Get<T>,
fn checked_mul( &self, rhs: &TypeWithDefault<T, D>, ) -> Option<TypeWithDefault<T, D>>
Implementors§
impl CheckedMul for polkadot_sdk_frame::hashing::U256
impl CheckedMul for polkadot_sdk_frame::hashing::U512
impl CheckedMul for FixedI64
impl CheckedMul for FixedI128
impl CheckedMul for FixedU64
impl CheckedMul for FixedU128
impl CheckedMul for PerU16
§Note
CheckedMul will never fail for PerThings.
impl CheckedMul for Perbill
§Note
CheckedMul will never fail for PerThings.
impl CheckedMul for Percent
§Note
CheckedMul will never fail for PerThings.
impl CheckedMul for Permill
§Note
CheckedMul will never fail for PerThings.
impl CheckedMul for Perquintill
§Note
CheckedMul will never fail for PerThings.