compute method

  1. @override
Result compute(
  1. ComputeContext context,
  2. Result leftHand,
  3. Result rightHand
)
override

Implementation

@override
Result compute(ComputeContext context, Result leftHand, Result rightHand) {
  if (rightHand.approximate() == Rational.zero) {
    throw ComputationError(ComputationStep.eval,
        message: 'Cannot divide by zero');
  }

  return leftHand / rightHand;
}