We have a generic calculation routine using Ncalc to evaluate a string. However we are running across a problem when the values in a multiplication are small enough that Ncalc sees them as int however the result is too big for an int.
Example:
var expr = new NCalc.Expression("1740263 * 1234");
object result = expr.Evaluate();
Console.WriteLine(result.ToString());
Console.ReadKey();
This results in a negative int value.
Is there any way to force Ncalc to use long for the calculation?
I have tried using parameters and this works but it would mean a major rewrite of our code to implement and I would like to avoid it if possible.
Thanks