N1QL uses golang float64 as data type.
which looses precision over -2^53 to 2^53 Double-precision floating-point format - Wikipedia
Track via MB-24464
N1QL internally handles the cas has int64 . If did not do any athematic operations on int64 it should give results as it is.
6.6.3 gives right results.
SELECT RAW TONUMBER("1639300746363797504");
{
"requestID": "3798863a-6f2d-48c4-9be0-c5c0fef14116",
"signature": "number",
"results": [
1639300746363797504
],
"status": "success",
"metrics": {
"elapsedTime": "574.031µs",
"executionTime": "517.815µs",
"resultCount": 1,
"resultSize": 19
}
}