You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var result = new Jint.Engine().Evaluate("2147483647 + 1");
// Actual: 'result' is of type Integer with value -2147483648
// Expected: 'result' would be of type Number with value 2147483648
Subtraction has a similar behaviour.
Thanks for your time.
The text was updated successfully, but these errors were encountered:
I'll take care of the fix and make a pull request. As I understood, both operations should follow the same pattern as the multiplication operator: cast the first operand to long before the operation in JintBinaryExpression.cs at lines 271 and 318. I'm just not sure where to put the unit test. I'll try to figure it out.
conicgames
changed the title
Interger addition leading to an overflow is not converted to Number
Integer addition/subtraction leading to an overflow is not converted to Number
Feb 16, 2022
Hello,
The following code doesn't behave as expected:
Subtraction has a similar behaviour.
Thanks for your time.
The text was updated successfully, but these errors were encountered: