C# Math calculator [duplicate]
DataTable has a Compute method that allows you to write this: var result = new DataTable().Compute(“2-3/4*12”, null); Note that this is limited to simple math expressions. Other option consist in using a dynamic language in the DLR such as IronPython and IronRuby. Check-out this post: var engine = new IronPython.Hosting.PythonEngine(); double result = pythonEngine.EvaluateAs<double>(“2-3/4*12”); You … Read more