.NET solutions:
Here couple of topics on SO:
- c# evaluating string “3*(4+2)” yield int 18
- Is it possible to translate a user-entered mathematical equation into C# code at runtime?
- Is there a string math evaluator in .NET?
- Best and shortest way to evaluate mathematical expressions
- C# Math calculator (closed)
Also two projects I already used brefore:
C#: NCalc - Mathematical Expressions Evaluator for .NET
NCalc is a mathematical expressions evaluator in .NET. NCalc can parse any expression and evaluate the result, including static or dynamic parameters and custom functions.
VB.NET: Fast Lightweight Expression Evaluator
Flee is an expression parser and evaluator for the .NET framework. It allows you to compute the value of string expressions such as sqrt(a^2 + b^2) at runtime. It uses a custom compiler, strongly-typed expression language, and lightweight codegen to compile expressions directly to IL. This means that expression evaluation is extremely fast and efficient. Try out the demo, which lets you generate images based on expressions, and see for yourself.
You can use it with C# since it .NET anyway (via assembly reference).