divide method

void divide(
  1. num other
)

Divides the current value by other.

Implementation

void divide(num other) {
  if (other == 0) throw ArgumentError('Cannot divide by zero');
  value = value / other;
}