logoalt Hacker News

int_19h12/09/20241 replyview on HN

Numbers aren't "surprisingly easy to define". Indeed, JSON is a very good example of how to not define numbers for interoperability. The original spec literally doesn't place any limits on valid ranges, precision etc, with the result that the later RFC notes that "in practice" you probably want to assume 64-bit floating point because that's what most parsers use (but still doesn't actually guarantee at least that much precision!).


Replies

The_Colonel12/09/2024

I wrote "quite easy to define" and they are, esp. in comparison to date/time. JSON messing it up notwithstanding.