Exemple #1
0
 Binary Binary::operator +(const Binary& B)
 {
   Binary sum(i+B.getInt());
   if(B.getBitSize() > sum.bitSize)
     sum.setBitSize(B.getBitSize());
   return sum;
 }
Exemple #2
0
 Binary Binary::operator |(const Binary& B)
 {
   Binary _or(i | B.getInt());
   if(B.getBitSize() > _or.bitSize)
     _or.setBitSize(B.getBitSize());
   return _or;
 }
Exemple #3
0
 Binary Binary::operator &(const Binary& B)
 {
   Binary _and(i & B.getInt());
   if(B.getBitSize() > _and.bitSize)
     _and.setBitSize(B.getBitSize());
   return _and;
 }
Exemple #4
0
 Binary Binary::operator -(const Binary& B)
 {
   Binary diff(i-B.i);
   if(B.getBitSize() > diff.bitSize)
     diff.setBitSize(B.getBitSize());
   return diff;
 }
Exemple #5
0
 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;
 }