- cross-posted to:
- programmerhumor
- [email protected]
- cross-posted to:
- programmerhumor
- [email protected]
Meme transcription:
Panel 1: Bilbo Baggins ponders, “After all… why should I care about the difference between int and String?
Panel 2: Bilbo Baggins is revealed to be an API developer. He continues, “JSON is always String, anyways…”
json doesn’t have ints, it has Numbers, which are ieee754 floats. if you want to precisely store the full range of a 64 bit int (anything larger than 2^53 -1) then string is indeed the correct type
Let me show you what Ethan has to say about this: https://feddit.org/post/319546/174361
No. numbers in JSON have arbitrary precision. The standard only specifies that implementations may impose restrictions on the allowed values.
https://www.rfc-editor.org/rfc/rfc8259.html#section-6