4 ms·
It's important to remember that JSON is "very close" to Javascript but is not actually Javascript. JSON allows arbitrary precision numbers. So, the number `1.00
by defen 9y ago
It's important to remember that JSON is "very close" to Javascript but is not actually Javascript. JSON allows arbitrary precision numbers. So, the number `1.0000000000000001` (or, similarly, an extremely large integer) isn't representable in standard Javascript, but if a JSON encoder emits that, a "proper" parser would actually parse that as an exact value (compare Python `simplejson.parse` with `use_decimal=True` vs `use_decimal=False`). I guess what I'm saying is that a proper JSON parser kinda already has this issue.