DynamicExpresso
DynamicExpresso copied to clipboard
Is this support biginter?
Hello: when i " Install-Package DynamicExpresso.Core " in C#(vs2019) , var interpreter = new Interpreter(); var wawawa = interpreter.Eval("335555555555333333333*444444444444444444444444444"); then throw (DynamicExpresso.Exceptions.ParseException:“Invalid integer literal '335555555555333333333' (at index 0).” )
Can you dim variable with biginter?
I suspect that this
335555555555333333333*444444444444444444444444444
is not a valid C# code and the idea of DynamicExpresso is to follow C# rules.
Can you please check if this is valid with C#?
It's not valid C#: 335555555555333333333
is too large to be represented by a C# integer, and the C# compiler will reject it with error CS1021 Integral constant is too large.
To compile your expression, you must do:
var a = BigInteger.Parse("335555555555333333333");
var b = BigInteger.Parse("444444444444444444444444444");
var c = a * b;
That being said, maybe we can add an option (or reuse the DefaultNumberType
option) to automatically parse large integers as big integers?
@caleb20000 Is this a real scenario or it was just a test? Do you expect that someone should really input such kind of expressions?