Module malachite_base::num::arithmetic::overflowing_mul
source · Expand description
OverflowingMul
and
OverflowingMulAssign
, traits for multiplying two numbers and
returning a boolean indicating whether an overflow occurred.
§overflowing_mul_assign
use malachite_base::num::arithmetic::traits::OverflowingMulAssign;
let mut x = 123u16;
assert_eq!(x.overflowing_mul_assign(456), false);
assert_eq!(x, 56088);
let mut x = 123u8;
assert_eq!(x.overflowing_mul_assign(200), true);
assert_eq!(x, 24);