divide static method

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

精确除法

Implementation

static num divide(dynamic num1, dynamic num2, [List<dynamic>? others]) {
  if (others != null) {
    return divide(
      divide(num1, num2),
      others[0],
      others.length >= 2 ? others.sublist(1) : null,
    );
  }
  num num1Changed = float2Fixed(num1);
  num num2Changed = float2Fixed(num2);
  checkBoundary(num1Changed);
  checkBoundary(num2Changed);
  return times(
    num1Changed / num2Changed,
    (pow(10, digitLength(num2) - digitLength(num1))),
  );
}