/// <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(); }
/// <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(); }