[Solved] Operator ‘+’ can’t be applied to operands of types ‘decimal’ and ‘double’ – NCalc [closed]
Ok. I looked at the source code. And here is what I found. The Abs(-1) part of the expression is always evaluated as a decimal Result = Math.Abs(Convert.ToDecimal( Evaluate(function.Expressions[0])) ); Cos(2) is evaluated as double Result = Math.Cos(Convert.ToDouble(Evaluate(function.Expressions[0]))); And C# does not allow you to add these two types together. The reason that Math.Abs(-1) + … Read more