Example #1
0
 /// <summary>
 /// Math Expression Evaluator
 /// </summary>
 /// <param name="expr"></param>
 /// <param name="replacements"></param>
 /// <returns></returns>
 public static double Evaulate(this string expr, Dictionary<string, double> replacements)
 {
     MathEval engine = new MathEval(expr);
     engine.AddReplacement(replacements);
     return engine.Evaluate();
 }
Example #2
0
 /// <summary>
 ///  Math Expression Evaluator
 /// </summary>
 /// <param name="expr"></param>
 /// <returns></returns>
 public static double Evaulate(this string expr)
 {
     MathEval engine = new MathEval(expr);
     return engine.Evaluate();
 }