private static void doClearRoundIntegerPortionAndAddOne(
      long fast0, long fast1, long fast2,
      int absRoundPower,
      FastHiveDecimal fastResult) {

    long result0;
    long result1;
    long result2;

    if (absRoundPower < LONGWORD_DECIMAL_DIGITS) {

      // Lowest word gets integer rounding.

      // Clear rounding portion in lower longword and add 1 at right scale (roundMultiplyFactor).

      final long roundFactor = powerOfTenTable[absRoundPower];

      final long r0 =
          ((fast0 / roundFactor) * roundFactor)
        + roundFactor;
      result0 = r0 % MULTIPLER_LONGWORD_DECIMAL;
      final long r1 =
          fast1
        + r0 / MULTIPLER_LONGWORD_DECIMAL;
      result1 = r1 % MULTIPLER_LONGWORD_DECIMAL;
      result2 =
          fast2
        + r1 / MULTIPLER_LONGWORD_DECIMAL;

    } else if (absRoundPower < TWO_X_LONGWORD_DECIMAL_DIGITS) {

      // Middle word gets integer rounding; lower longword is cleared.

      final int adjustedAbsPower = absRoundPower - LONGWORD_DECIMAL_DIGITS;

      // Clear rounding portion in middle longword and add 1 at right scale (roundMultiplyFactor);
      // lower longword result is 0;

      final long roundFactor = powerOfTenTable[adjustedAbsPower];

      result0 = 0;
      final long r1 =
          ((fast1 / roundFactor) * roundFactor)
        + roundFactor;
      result1 = r1 % MULTIPLER_LONGWORD_DECIMAL;
      result2 =
          fast2
        + r1 / MULTIPLER_LONGWORD_DECIMAL;

    } else {

      // High word gets integer rounding; middle and lower longwords are cleared.

      final int adjustedAbsPower = absRoundPower - TWO_X_LONGWORD_DECIMAL_DIGITS;

      // Clear rounding portion in high longword and add 1 at right scale (roundMultiplyFactor);
      // middle and lower longwords result is 0;

      final long roundFactor = powerOfTenTable[adjustedAbsPower];

      result0 = 0;
      result1 = 0;
      result2 =
          ((fast2 / roundFactor) * roundFactor)
        + roundFactor;

    }

    fastResult.fast0 = result0;
    fastResult.fast1 = result1;
    fastResult.fast2 = result2;
  }
*********************************************************************************************
  // Decimal Rounding.

  public static boolean doFastRound(
      int fastSignum, long fast0, long fast1, long fast2,
      int fastIntegerDigitCount, int fastScale,
      int roundPower,
      int roundingMode,
      FastHiveDecimal fastResult) {

    if (fastSignum == 0) {

      // Zero result.
      fastResult.fastReset();
      return true;
    } else if (fastScale == roundPower) {

      // The roundPower same as scale means all zeroes below round point.

      fastResult.fastSet(fastSignum, fast0, fast1, fast2, fastIntegerDigitCount, fastScale);
      /*
      if (!fastResult.fastIsValid()) {
        fastResult.fastRaiseInvalidException();
      }
storage-api/src/java/org/apache/hadoop/hive/common/type/FastHiveDecimalImpl.java