示例#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();
 }
示例#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();
 }