|
|
|
|
|
by kemayo
3277 days ago
|
|
That's per the spec[1], enjoyably: Note that when such software is used, numbers that are
integers and are in the range [-(2**53)+1, (2**53)-1]
are interoperable in the sense that implementations will
agree exactly on their numeric values.
2^53 is only 9007199254740990, so it's not too hard to exceed that, particularly in things like twitter status ids.The recommended use is to have big numbers as strings, since it's the only way to reliably pass them around. (Yes, this is kind of horrible.) [1]: https://tools.ietf.org/html/rfc7159#section-6 |
|
And I'd go from "kind of horrible" to just "horrible".
Integral bit limits are an implementation detail that every language has a way to overcome - they shouldn't be built into an encoding spec.