operator / method

Value operator /(
  1. dynamic other
)

Implementation

Value operator /(dynamic other) {
  final o = Value.toValue(other);
  if (o.data == 0) {
    throw Exception("Division by zero error.");
  }
  final out = Value(data / o.data, {this, o}, '/');
  out._backward = () {
    grad += (1 / o.data) * out.grad; // Correct for this
    o.grad += (-data / (o.data * o.data)) * out.grad; // Correct for o
  };
  return out;
}