No, not every JSON number is strictly converted with some specific IEEE 754 binary64 number (the so-called double precision aka "double").
In many situations, using JSON numbers is sufficient. It depends on what kind of guarantees you or the people whose data you transmit will be needed. Without agreement outside of JSON, there will be no clear definition of which JSON numbers are equivalent to doubling. However, in many situations, you can implicitly assume that the required accuracy is within two pairs. Many floating point numbers are physical measurements made with easily accessible tools.
Here is one way to make an exact agreement outside of JSON. One author suggested in an article on the Internet that if double is what you want, then in your JSON you can put an array or an object that contains three components of this structure as integers: sign, exponent and mantissa. Then, people who use the document must know the rules for interpreting a double of its three components, which are considered integers. When the integer of the "exponent" is 2047, the double value is NaN , etc.
There are more complex and more standard features. You can use HDF5 or match if you need it. There is already more than one specification on how to represent HDF5 in JSON. Then your JSON document can be self-descriptive in the form of HDF5, annotating your number as type H5T_IEEE_F64BE.
source share