Binary Binary::operator +(const Binary& B) { Binary sum(i+B.getInt()); if(B.getBitSize() > sum.bitSize) sum.setBitSize(B.getBitSize()); return sum; }
Binary Binary::operator |(const Binary& B) { Binary _or(i | B.getInt()); if(B.getBitSize() > _or.bitSize) _or.setBitSize(B.getBitSize()); return _or; }
Binary Binary::operator &(const Binary& B) { Binary _and(i & B.getInt()); if(B.getBitSize() > _and.bitSize) _and.setBitSize(B.getBitSize()); return _and; }
Binary Binary::operator -(const Binary& B) { Binary diff(i-B.i); if(B.getBitSize() > diff.bitSize) diff.setBitSize(B.getBitSize()); return diff; }
Binary Binary::operator ^(const Binary& B) { Binary::value_type tempInt = i & B.i; Binary _xor(tempInt); if(B.bitSize > _xor.bitSize) _xor.bitSize = B.getBitSize(); return _xor; }