public static void fastFractionPortion(
      int fastSignum, long fast0, long fast1, long fast2,
      int fastScale,
      FastHiveDecimal fastResult) {

    if (fastSignum == 0 || fastScale == 0) {
      fastResult.fastReset();
      return;
    }

    // Clear integer portion; keep fraction.

    // Adjust all longs using power 10 division/remainder.
    long result0;
    long result1;
    long result2;
    if (fastScale < LONGWORD_DECIMAL_DIGITS) {

      // Part of lowest word survives.

      final long clearFactor = powerOfTenTable[fastScale];

      result0 = fast0 % clearFactor;
      result1 = 0;
      result2 = 0;

    } else if (fastScale < TWO_X_LONGWORD_DECIMAL_DIGITS) {

      // Throw away lowest word.

      final int adjustedScaleDown = fastScale - LONGWORD_DECIMAL_DIGITS;

      final long clearFactor = powerOfTenTable[adjustedScaleDown];

      result0 = fast0;
      result1 = fast1 % clearFactor;
      result2 = 0;

    } else {

      // Throw away middle and lowest words.

      final int adjustedScaleDown = fastScale - 2*LONGWORD_DECIMAL_DIGITS;

      final long clearFactor = powerOfTenTable[adjustedScaleDown];

      result0 = fast0;
      result1 = fast1;
      result2 = fast2 % clearFactor;

    }
    if (result0 == 0 && result1 == 0 && result2 == 0) {
      fastResult.fastReset();
    } else {
      fastResult.fastSet(fastSignum, result0, result1, result2, /* fastIntegerDigitCount */ 0, fastScale);
    }
  }
*********************************************************************************************
  // Take Integer or Fractional Portion.

  /**
Creates fast decimal from the fraction portion of a fast decimal.

NOTE: The fastFractionPortion method requires the caller to pass a fastResult
parameter has been reset for better performance.

@param fastSignum the sign of the number (1, 0, or -1)
@param fast0 high bits
@param fast1 second word bits
@param fast2 third word bits
@param fastScale the scale
@param fastResult an object to reuse
storage-api/src/java/org/apache/hadoop/hive/common/type/FastHiveDecimalImpl.java