@HiveDecimalVersionV1
  public HiveDecimal setScale(
      int roundingPoint, int roundingMode) {
    if (fastScale() == roundingPoint) {
      // No change.
      return this;
    }

    // Even if we are just setting the scale when newScale is greater than the current scale,
    // we need a new object to obey our immutable behavior.
    HiveDecimal result = new HiveDecimal();
    if (!fastRound(
        roundingPoint, roundingMode,
        result)) {
      return null;
    }
    return result;
  }
Do decimal rounding and return the result.
<p>
When the roundingPoint is 0 or positive, we round away lower fractional digits if the
roundingPoint is less than current scale.  In this case, we will round the result using the
specified rounding mode.
<p>
When the roundingPoint is negative, the rounding will occur within the integer digits.  Integer
digits below the roundPoint will be cleared.  If the rounding occurred, a one will be added
just above the roundingPoint.  Note this may cause overflow.
<p>
No effect when the roundingPoint equals the current scale.  The current object is returned.
<p>
The name setScale is taken from BigDecimal.setScale -- a better name would have been round.
storage-api/src/java/org/apache/hadoop/hive/common/type/HiveDecimal.java