Exemple #1
0
 public void ChangeLastOperation(Operation op)
 {
     if(operations.Count != 0)
         operations[operations.Count - 1] = op;
 }
Exemple #2
0
        private double Calculate(Operation op, double left, double right)
        {
            switch (op) {
                case Operation.Plus:
                    return left + right;

                case Operation.Minus:
                    return left - right;

                case Operation.Mult:
                    return left * right;

                case Operation.Div:
                    return left / right;

                default:
                    return double.PositiveInfinity;
            }
        }
Exemple #3
0
 public void AddOperation(Operation op)
 {
     operations.Add(op);
 }