Trait num_traits::ops::overflowing::OverflowingAdd
source · [−]pub trait OverflowingAdd: Sized + Add<Self, Output = Self> {
fn overflowing_add(&self, v: &Self) -> (Self, bool);
}
Expand description
Performs addition with a flag for overflow.
Required Methods
fn overflowing_add(&self, v: &Self) -> (Self, bool)
fn overflowing_add(&self, v: &Self) -> (Self, bool)
Returns a tuple of the sum along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.