Module malachite_base::num::arithmetic::wrapping_mul

source ·
Expand description

WrappingMul and WrappingMulAssign, traits for multiplying two numbers and wrapping at the boundary of the type.

§wrapping_mul_assign

use malachite_base::num::arithmetic::traits::WrappingMulAssign;

let mut x = 123u16;
x.wrapping_mul_assign(456);
assert_eq!(x, 56088);

let mut x = 123u8;
x.wrapping_mul_assign(200);
assert_eq!(x, 24);