I'm using NCalc to evaluate complex expressions. But I've found a major problem.
A simple formula like new Expression("Abs(-1) + Cos(2)").Evaluate()
throws the exception
Operator '+' can't be applied to operands of types 'decimal' and 'double
In C# code Math.Abs(-1) + Math.Cos(2)
works, so either I'm doing something wrong or there is a bug in NCalc.
Does anyone have the same problem?
Does anyone have a solution?
The only thread i found on the project's website related to this error is quite old and talks about editing the source code. https://ncalc.codeplex.com/discussions/346702
I also posted a question on their forum but StackOverflow is usualy more dynamic. https://ncalc.codeplex.com/discussions/613634