plus static method

num plus(
  1. dynamic num1,
  2. dynamic num2, [
  3. List? others
])

精确加法

Implementation

static num plus(dynamic num1, dynamic num2, [List<dynamic>? others]) {
  if (others != null) {
    return plus(plus(num1, num2), others[0], others.length >= 2 ? others.sublist(1) : null);
  }
  num baseNum = pow(10, max(digitLength(num1), digitLength(num2)));
  return (times(num1, baseNum) + times(num2, baseNum)) / baseNum;
}