Closed
Description
The JSON specification doesn't support special floating values such as any NaN value or +/-infinity. But many (if not most) Json libraries at least provide a special Flag to allow them. As an example see the flag serializeSpecialFloatingPointValues of the google-Gson library:
It seems that the choice of representation chosen here (NaN
for a NaN, Infinity
and -Infinity
for positive/negative infinity is quite popular and I recommend to use them when this feature is active.
Other JSON library with similar support:
https://github.com/aseemk/json5
https://simplejson.readthedocs.org/en/latest/