Example #1
0
 public Expression(string expression, ICalculate calc)
 {
     MathExpression = expression;
     Steps          = MathExpression;
     if (calc is null)
     {
         Result       = 0;
         ErrorMessage = "Null Calculate";
     }
     else
     {
         var res = calc.Parse(this);
         Result       = res.Result;
         ErrorMessage = res.ErrorMessage;
     }
 }