4 ms·
>Every number in JSON is implicitly a double-precision float Is it? I was under the impression every number in JSON is implicitly arbitrary precision.
by uhoh-itsmaciek 7y ago
>Every number in JSON is implicitly a double-precision float
Is it? I was under the impression every number in JSON is implicitly arbitrary precision.
- jacobolus 7y agoYou can write an arbitrary precision number in there, say 4.203984572938457290834572098345787564e+20, but if the vast majority of JSON parsers interpret it as a double-precision float, there’s not much point. If you control both the producer and consumer of the serialized data, you can of course do whatever you like. But I would recommend people who want more extensive data types use something other than JSON.
- ben509 7y ago> If you control both the producer and consumer of the serialized data, you can of course do whatever you like. Don't forget all the unintended intermediate producers and consumers due to microservices or even otherwise well-written tools that convert to float64 internally.