JSON vs IETF JSON

This is likely (directly or indirectly) the fault of a single paragraph in IETF RFC-7159 / RFC-8259 (shown in the attached screen-shot).

(And note that, there is a difference between JSON and IETF JSON. JSON did not have this. IETF JSON does.)

That paragraph (in the IETF RFC) was NOT a requirement. But, others made it a requirement — including JSON-LD.

RE: mastodon.social/@reiver/115956

This specification allows implementations to set limits on the range and precision of numbers accepted.  Since software that implements IEEE 754 binary64 (double precision) numbers [IEEE754] is generally available and widely used, good interoperability can be achieved by implementations that expect no more precision or range than these provide, in the sense that implementations will approximate JSON numbers within the expected precision.  A JSON number such as 1E400 or 3.141592653589793238462643383279 may indicate potential interoperability problems, since it suggests that the software that created it expects receiving software to have greater capabilities for numeric magnitude and precision than is widely available.

There is a larger discussion about fixed-point numbers versus floating-point numbers.

And that, ALL programming-languages should have fixed-point numbers built into them.

And that, programmers should be warned against using floating-point numbers in all but a set of very specialized situations — where inexact math is OK.

For most programmers in most situations inexact math is NOT OK. And, they should NOT use floating-point numbers.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.social/users/reiver/statuses/116115627967749999 on your instance and quote it. (Note that quoting is not supported in Mastodon.)