add method

UcumDecimal add(
  1. UcumDecimal other
)

Implementation

UcumDecimal add(UcumDecimal other) {
  if (negative == other.negative) {
    final UcumDecimal result = doAdd(other);
    result.negative = negative;
    return result;
  } else if (negative) {
    return other.doSubtract(this);
  } else {
    return doSubtract(other);
  }
}