public static boolean fastSetFromLongAndScale(
      long longValue, int scale, FastHiveDecimal fastResult) {

    if (scale < 0 || scale > HiveDecimal.MAX_SCALE) {
      return false;
    }

    fastSetFromLong(longValue, fastResult);
    if (scale == 0) {
      return true;
    }

    if (!fastScaleByPowerOfTen(
        fastResult,
        -scale,
        fastResult)) {
      return false;
    }
    return true;
  }
Creates a fast decimal from a long with a specified scale.

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

@param longValue the value to set as a long
@param scale the scale to use
@param fastResult an object to reuse
@return was the conversion successful?
storage-api/src/java/org/apache/hadoop/hive/common/type/FastHiveDecimalImpl.java