3 ms·
JSON Numbers cannot represent all possible values of an IEEE754 Double (IE Javascript numbers) since it's missing all of the NANs and infinities. JSON Numbers
by SAI_Peregrinus 6y ago
JSON Numbers cannot represent all possible values of an IEEE754 Double (IE Javascript numbers) since it's missing all of the NANs and infinities.
JSON Numbers cannot all be represented in an IEEE754 Double, since they're arbitrary precision sequences of unbounded size.
This bit me recently, and so I'm slightly bitter about it.
- RhysU 6y agoNaNs are a big gap and one that constantly worries me.
- olliej 6y agoIt never stops annoying me that nan and Infinity are properties in JS, and JSON doesn’t just specialize for those values :-/
- rrauenza 6y agoYes - this bit me as well this year! I had to switch my APIs to message pack.
- rurban 6y agoProper nan and inf support is by far the biggest trouble in my popular Perl library for JSON. But it's easily done, just as extension to the standard. The standard lacks many things and has a lot of holes. Newer standards iterations also made things worse, not better. Bad, but still the best and easiest and most secure, if you ignore the latest nonsense.