Module malachite_base::num::arithmetic::wrapping_sub_mul
source · Expand description
WrappingSubMul
and
WrappingSubMulAssign
, traits for subtracting a number by the
product of two other numbers and wrapping at the boundary of the type.
§wrapping_sub_mul
use malachite_base::num::arithmetic::traits::WrappingSubMul;
assert_eq!(127i8.wrapping_sub_mul(2, 100), -73);
assert_eq!((-127i8).wrapping_sub_mul(2, 100), -71);
§wrapping_sub_mul_assign
use malachite_base::num::arithmetic::traits::WrappingAddMulAssign;
let mut x = 2u8;
x.wrapping_add_mul_assign(3, 7);
assert_eq!(x, 23);
let mut x = -127i8;
x.wrapping_add_mul_assign(-2, 100);
assert_eq!(x, -71);