[][src]Trait sp_runtime::traits::CheckedDiv

pub trait CheckedDiv: Div<Self, Output = Self> {
    pub fn checked_div(&self, v: &Self) -> Option<Self>;
}

Performs division that returns None instead of panicking on division by zero and instead of wrapping around on underflow and overflow.

Required methods

pub fn checked_div(&self, v: &Self) -> Option<Self>

Divides two numbers, checking for underflow, overflow and division by zero. If any of that happens, None is returned.

Loading content...

Implementations on Foreign Types

impl<T> CheckedDiv for Ratio<T> where
    T: Clone + Integer + CheckedMul
[src]

impl CheckedDiv for BigInt[src]

impl CheckedDiv for BigUint[src]

impl CheckedDiv for u64[src]

impl CheckedDiv for u128[src]

impl CheckedDiv for i128[src]

impl CheckedDiv for i64[src]

impl CheckedDiv for u16[src]

impl CheckedDiv for i8[src]

impl CheckedDiv for i32[src]

impl CheckedDiv for usize[src]

impl CheckedDiv for i16[src]

impl CheckedDiv for u32[src]

impl CheckedDiv for u8[src]

impl CheckedDiv for isize[src]

Loading content...

Implementors

impl CheckedDiv for FixedI64[src]

impl CheckedDiv for FixedI128[src]

impl CheckedDiv for FixedU128[src]

Loading content...