quinnj / JSON3.jl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inconsistent behaviour for NaNs and Infs

tanhevg opened this issue · comments

JSON standard only supports scientific decimal representation of floating point numbers. This leaves out Infs and NaNs. JSON3 currently represents these as string null when writing, and throws an error when trying to read them (into a struct). This behaviour needs to be consistent: either throw an error when trying to write something that is not supported by the standard, or augment the format by allowing NaN and Inf as floating point numbers. My preference would be the latter.

What do you think?

I think we should throw an error. Better to be explicit upfront. PR up.