private static boolean isRoundPortionHalfUp(
      long fast0, long fast1, long fast2,
      int roundingPoint) {

    boolean isRoundPortionHalfUp;
    if (roundingPoint < LONGWORD_DECIMAL_DIGITS) {

      // Lowest word gets integer rounding.

      // Divide down just before round point to get round digit.
      final long withRoundDigit = fast0 / powerOfTenTable[roundingPoint - 1];
      final long roundDigit = withRoundDigit % 10;

      isRoundPortionHalfUp = (roundDigit >= 5);

    } else if (roundingPoint < TWO_X_LONGWORD_DECIMAL_DIGITS) {

      // Middle word gets integer rounding.

      final int adjustedRoundingPoint = roundingPoint - LONGWORD_DECIMAL_DIGITS;

      long roundDigit;
      if (adjustedRoundingPoint == 0) {
        // Grab round digit from lowest word.
        roundDigit = fast0 / (MULTIPLER_LONGWORD_DECIMAL / 10);
      } else {
        // Divide down just before scaleDown to get round digit.
        final long withRoundDigit = fast1 / powerOfTenTable[adjustedRoundingPoint - 1];
        roundDigit = withRoundDigit % 10;
      }

      isRoundPortionHalfUp = (roundDigit >= 5);

    } else {

      // High word gets integer rounding.

      final int adjustedRoundingPoint = roundingPoint - TWO_X_LONGWORD_DECIMAL_DIGITS;

      long roundDigit;
      if (adjustedRoundingPoint == 0) {
        // Grab round digit from middle word.
        roundDigit = fast1 / (MULTIPLER_LONGWORD_DECIMAL / 10);
      } else {
        // Divide down just before scaleDown to get round digit.
        final long withRoundDigit = fast2 / powerOfTenTable[adjustedRoundingPoint - 1];
        roundDigit = withRoundDigit % 10;
      }

      isRoundPortionHalfUp = (roundDigit >= 5);

    }
    return isRoundPortionHalfUp;
  }
*********************************************************************************************
  // 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