Given the following flags,
[Flags]
public enum Operations
{
add = 1,
subtract = 2,
multiply = 4,
divide = 8,
ev
Try this:
public double Evaluate(double input)
{
if ((operation & (Operations.add | Operations.eval)) == (Operations.add | Operations.eval))
currentResult += input;
else if ((operation & (Operations.subtract | Operations.eval)) == (Operations.subtract | Operations.eval))
currentResult -= input;
else
currentResult = input;
operation = null;
return currentResult;
}