4 ms·
No, that's just how JavaScript reads them, because JavaScript only has float64. JSON itself allows arbitrary large decimal numbers, including uint64.
by RedNifre 5y ago
No, that's just how JavaScript reads them, because JavaScript only has float64. JSON itself allows arbitrary large decimal numbers, including uint64.
- forrestthewoods 5y agoI suppose you're right that the formal JSON specification doesn't actual specify what a number actually is. Only that it's a sequence of digits. TIL. In practice, when you are using JSON as an interchange format between tools and systems it is exceptionally likely that you'll be constrained to 64-bit float as the underlying Number data type. Even if there is no JavaScript anywhere in your data pipeline. I have been burned by this repeatedly. For the record, I have never written a single line of JavaScript in my professional career. In any case, my dream format would separate storage type from encoding type and formalize implementation extensions.