Trait num_traits::ops::euclid::CheckedEuclid
source · [−]pub trait CheckedEuclid: Euclid {
fn checked_div_euclid(&self, v: &Self) -> Option<Self>;
fn checked_rem_euclid(&self, v: &Self) -> Option<Self>;
}
Required Methods
fn checked_div_euclid(&self, v: &Self) -> Option<Self>
fn checked_div_euclid(&self, v: &Self) -> Option<Self>
Performs euclid division that returns None
instead of panicking on division by zero
and instead of wrapping around on underflow and overflow.
fn checked_rem_euclid(&self, v: &Self) -> Option<Self>
fn checked_rem_euclid(&self, v: &Self) -> Option<Self>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and
division by zero. If any of that happens, None
is returned.