public void BitAndNot_pos_pos() { uint digit1 = 0xACACACAC; uint digit2 = 0xCACACACA; BigInteger x = new BigInteger(1, new uint[] { digit1, digit2, digit1, digit2 }); BigInteger y = new BigInteger(1, new uint[] { digit1, digit2, 0 }); uint d0 = digit1; uint d1 = digit2 & ~digit1; uint d2 = digit1 & ~digit2; uint d3 = digit2; BigInteger z = new BigInteger(1, new uint[] { d0, d1, d2, d3 }); BigInteger w = x.BitwiseAndNot(y); Expect(w == z); }
public void BitAndNot_neg_neg() { uint digit1 = 0xACACACAC; uint digit2 = 0xCACACACA; BigInteger x = new BigInteger(-1, new uint[] { digit1, digit2, digit1, digit2 }); BigInteger y = new BigInteger(-1, new uint[] { digit1, digit2, 0 }); uint d0 = ~digit2 & digit1; uint d1 = ~digit1 & ~(~digit2 + 1); uint d2 = ~digit2 + 1; BigInteger z = new BigInteger(1, new uint[] { d0, d1, d2 }); BigInteger w = x.BitwiseAndNot(y); Expect(w == z); }