/// Performs addition that saturates at the numeric bounds instead of overflowing. pubtrait SaturatingAdd: Sized + Add<Self, Output = Self> { /// Saturating addition. Computes `self + other`, saturating at the relevant high or low boundary of /// the type. fn saturating_add(&self, v: &Self) -> Self;
}
/// Performs subtraction that saturates at the numeric bounds instead of overflowing. pubtrait SaturatingSub: Sized + Sub<Self, Output = Self> { /// Saturating subtraction. Computes `self - other`, saturating at the relevant high or low boundary of /// the type. fn saturating_sub(&self, v: &Self) -> Self;
}
/// Performs multiplication that saturates at the numeric bounds instead of overflowing. pubtrait SaturatingMul: Sized + Mul<Self, Output = Self> { /// Saturating multiplication. Computes `self * other`, saturating at the relevant high or low boundary of /// the type. fn saturating_mul(&self, v: &Self) -> Self;
}
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.