hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/terasort/Unsigned16.java
/**
   * Add the given number into the current number.
   * @param b the other number
   */
Add the given number into the current number.
@param b the other number
Add the given number into the current number . @param b the other number
public void add(Unsigned16 b) {
    long sumHi;
    long sumLo;
    long  reshibit, hibit0, hibit1;
    sumHi = hi8 + b.hi8;
    hibit0 = (lo8 & 0x8000000000000000L);
    hibit1 = (b.lo8 & 0x8000000000000000L);
    sumLo = lo8 + b.lo8;
    reshibit = (sumLo & 0x8000000000000000L);
    if ((hibit0 & hibit1) != 0 | ((hibit0 ^ hibit1) != 0 && reshibit == 0))
      sumHi++;  /* add carry bit */
    hi8 = sumHi;
    lo8 = sumLo;
  }
public void add ( Unsigned16 b ) { long sumHi ; long sumLo ; long reshibit , hibit0 , hibit1 ; sumHi = hi8 + b . hi8 ; hibit0 = ( lo8 & 0x8000000000000000L ) ; hibit1 = ( b . lo8 & 0x8000000000000000L ) ; sumLo = lo8 + b . lo8 ; reshibit = ( sumLo & 0x8000000000000000L ) ; if ( ( hibit0 & hibit1 ) != 0 | ( ( hibit0 ^ hibit1 ) != 0 && reshibit == 0 ) ) sumHi ++ ; /* add carry bit */ hi8 = sumHi ; lo8 = sumLo ; }
Add the given number into the current number.
Add the given number into the current number .