computeCalcOperationSymbol function

num computeCalcOperationSymbol(
  1. CalcOperation op,
  2. num a,
  3. num b
)

Implementation

num computeCalcOperationSymbol(CalcOperation op, num a, num b) {
  switch (op) {
    case CalcOperation.sum:
      return a + b;
    case CalcOperation.subtract:
      return a - b;
    case CalcOperation.multiply:
      return a * b;
    case CalcOperation.divide:
      return a / b;
    default:
      throw StateError("Can't compute: $op");
  }
}