-
Type:
Bug
-
Resolution: Done
-
Priority:
Minor - P4
-
Affects Version/s: None
-
Component/s: JavaScript
-
None
-
Fully Compatible
-
ALL
-
Build 7 08/10/15, Build 8 08/31/15
-
None
-
0
-
None
-
None
-
None
-
None
-
None
-
None
Actual Test | SM | V8 ____________________________________|__________________________________________|_________________________________________ NumberLong("18446744073709551616") | Tue Feb 26 13:45:55.895 Error: could not convert string to long long (shell eval):1 | Tue Feb 26 13:45:55.863 Error: could not convert "18446744073709551616" to NumberLong (shell eval):1 NumberLong(18446744073709551616) | NumberLong("-9223372036854775808") | NumberLong("-9223372036854775808") NumberLong("-18446744073709551616") | Tue Feb 26 13:45:56.028 Error: could not convert string to long long (shell eval):1 | Tue Feb 26 13:45:55.996 Error: could not convert "-18446744073709551616" to NumberLong (shell eval):1 NumberLong(-18446744073709551616) | NumberLong("-9223372036854775808") | NumberLong("-9223372036854775808") NumberLong("9223372036854775808") | Tue Feb 26 13:45:56.162 Error: could not convert string to long long (shell eval):1 | Tue Feb 26 13:45:56.131 Error: could not convert "9223372036854775808" to NumberLong (shell eval):1 NumberLong(9223372036854775808) | NumberLong("-9223372036854775808") | NumberLong("-9223372036854775808") NumberLong("-9223372036854775808") | NumberLong("-9223372036854775808") | NumberLong("-9223372036854775808") NumberLong(-9223372036854775808) | NumberLong("-9223372036854775808") | NumberLong("-9223372036854775808") NumberInt("4294967296") | NumberInt(0) | NumberInt(0) NumberInt(4294967296) | NumberInt(-2147483648) | NumberInt(0) NumberInt("-4294967296") | NumberInt(0) | NumberInt(0) NumberInt(-4294967296) | NumberInt(-2147483648) | NumberInt(0) NumberInt("2147483648") | NumberInt(-2147483648) | NumberInt(-2147483648) NumberInt(2147483648) | NumberInt(-2147483648) | NumberInt(-2147483648) NumberInt("-2147483648") | NumberInt(-2147483648) | NumberInt(-2147483648) NumberInt(-2147483648) | NumberInt(-2147483648) | NumberInt(-2147483648) Number("18446744073709551616") | 18446744073709552000 | 18446744073709552000 Number(18446744073709551616) | 18446744073709552000 | 18446744073709552000 Number("-18446744073709551616") | -18446744073709552000 | -18446744073709552000 Number(-18446744073709551616) | -18446744073709552000 | -18446744073709552000 Number("9223372036854775808") | 9223372036854776000 | 9223372036854776000 Number(9223372036854775808) | 9223372036854776000 | 9223372036854776000 Number("-9223372036854775808") | -9223372036854776000 | -9223372036854776000 Number(-9223372036854775808) | -9223372036854776000 | -9223372036854776000
The inconsistency comes when handling 2^32. SM effectively "caps" overflows, converting them to the largest possible value (which is negative because this is a signed int), while v8 just converts overflows to zero.
Actual Test | SM | V8 ____________________________________|__________________________________________|_________________________________________ NumberInt(4294967296) | NumberInt(-2147483648) | NumberInt(0) NumberInt(-4294967296) | NumberInt(-2147483648) | NumberInt(0)
- is related to
-
SERVER-10965 Would like Min/Max value constants for NumberInt() and NumberLong()
-
- Closed
-