-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
None
-
Affects Version/s: 3.2.7
-
Component/s: Internal Client, Internal Code
-
None
-
ALL
-
Please, reroute me if this has a workaround for 64 bits, data handling (can't afford bits modifications by the database, or the database interface)
When using the mongo shell client in Linux, storing a 64 bits long integer result in a stored value different in more than 60 bits.
Is unknown if the problem is a client error, a database error or a data handling error.
Storing .. 9223372036854775804 (0x7FFFFFFFFFFFFFFC)
Stored .. -9223372036854775808 (0x8000000000000000)
62 bits differs
Storing .. 4611686018427387900 (0x3FFFFFFFFFFFFFFC)
Stored ... 4611686018427387904 (0x4000000000000000)
61 bits differs
Storing .. 2305843009213693951 (0x1FFFFFFFFFFFFFFF)
Stored ... 2305843009213693952 (0x2000000000000000)
62 bits differs
Storing .. 1152921504606846975 (0x0FFFFFFFFFFFFFFF)
Stored ... 1152921504606846976 (0x1000000000000000)
61 bits differs
Storing ... 576460752303423487 (0x07FFFFFFFFFFFFFF)
Stored .... 576460752303423488 (0x0800000000000000)
60 bits differs
Storing ... 288230376151711743 (0x03FFFFFFFFFFFFFF)
Stored .... 288230376151711744 (0x0400000000000000)
59 bits differs
I manage to pin point the border of the problem, when the bit 52 is on, the minor bits appears to be rounded (This make match with the 53 bits of mantissa for the IEEE 754 64 bit double precision floating point), the maximum number assignable (in case of restart, with initialization) is: 9,007,199,254,740,991
Storing ...... 9007199254740991 (0x001FFFFFFFFFFFFF)
Stored ....... 9007199254740991 (0x001FFFFFFFFFFFFF)
NO bits differs
- is related to
-
SERVER-30729 NumberLong compare with Number
- Closed
- related to
-
SERVER-2477 Shell is displaying some numbers in a collection as NumberLong("4187327222") and others as NumberLong(2109107744)
- Closed
-
SERVER-7812 NumberLong(max_of_int64) returns wrong result in mongo shell
- Closed