/// Performs addition with a flag for overflow. pubtrait OverflowingAdd: Sized + Add<Self, Output = Self> { /// 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. fn overflowing_add(&self, v: &Self) -> (Self, bool);
}
/// Performs substraction with a flag for overflow. pubtrait OverflowingSub: Sized + Sub<Self, Output = Self> { /// 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. fn overflowing_sub(&self, v: &Self) -> (Self, bool);
}
/// Performs multiplication with a flag for overflow. pubtrait OverflowingMul: Sized + Mul<Self, Output = Self> { /// Returns a tuple of the product along with a boolean indicating whether an arithmetic overflow would occur. /// If an overflow would have occurred then the wrapped value is returned. fn overflowing_mul(&self, v: &Self) -> (Self, bool);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.