BitString (BitString other) { long xorBits = myBits ^ other.myBits; // if bit is unknown in either operand, it's unknown in the result; otherwise we may xor normally long xorMask = myMask & other.myMask; return new BitString(xorBits, xorMask); }