bredelings / MCON

0 stars 0 forks source link

JSON for Infinity, -Infinity, NaN #7

Open bredelings opened 11 months ago

bredelings commented 11 months ago

JSON doesn't allow for Inf, -Inf, or NaN.

Python's implementation of JSON allows reading (Infinity,-Infinity,NaN) which is how javascript represents these values but is not valid according to the JSON spec.

Boost.JSON writes (1e99999, -1e99999, null) by default, but allows writing (Infinity,-Infinity,NaN). It can read both versions.

Some packages (i.e. nlohmann:json) write null for these values.

See https://github.com/boostorg/json/issues/397