Trait num_traits::ops::overflowing::OverflowingSub
source · pub trait OverflowingSub: Sized + Sub<Self, Output = Self> {
// Required method
fn overflowing_sub(&self, v: &Self) -> (Self, bool);
}
Expand description
Performs substraction with a flag for overflow.
Required Methods§
sourcefn overflowing_sub(&self, v: &Self) -> (Self, bool)
fn overflowing_sub(&self, v: &Self) -> (Self, bool)
Returns a tuple of the difference along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.