@@ -288,6 +288,7 @@ impl<'a> BitAndAssign<&'a BigUint> for BigUint {
*ai &= bi;
}
self.data.truncate(other.data.len());
+ self.normalize();
@@ -203,6 +203,8 @@ const BIT_TESTS: &'static [(&'static [BigDigit],
&'static [BigDigit],
&'static [BigDigit])] = &[// LEFT RIGHT AND OR XOR
(&[], &[], &[], &[], &[]),
+ (&[1, 0, 1], &[1, 1], &[1], &[1, 1, 1], &[0, 1, 1]),
+ (&[1, 0, 1], &[0, 1, 1], &[0, 0, 1], &[1, 1, 1], &[1, 1]),
(&[268, 482, 17],
&[964, 54],
&[260, 34],