public int divideDestructive(int right) {
    assert (right >= 0);
    long rightUnsigned = right & SqlMathUtil.LONG_MASK;

    long quotient;
    long remainder = 0;

    for (int i = INT_COUNT - 1; i >= 0; --i) {
      remainder = ((this.v[i] & SqlMathUtil.LONG_MASK) + (remainder << 32));
      quotient = remainder / rightUnsigned;
      remainder %= rightUnsigned;
      this.v[i] = (int) quotient;
    }
    updateCount();
    return (int) remainder;
  }
Divides this value with the given value. This version is destructive,
meaning it modifies this object.

@param right
         the value to divide
@return remainder
common/src/java/org/apache/hadoop/hive/common/type/UnsignedInt128.java