abs method

BigDecimal abs()

Returns the absolute value of this BigDecimal.

Implementation

BigDecimal abs() {
  return _unscaledValue.isNegative
      ? BigDecimal._(-_unscaledValue, _scale)
      : this;
}