klaxon icon indicating copy to clipboard operation
klaxon copied to clipboard

Is there any way to configure or modify the parsing such that Klaxon can handle `NaN` in input?

Open robert-dodier opened this issue 2 years ago • 1 comments

The literal NaN is recognized by some JSON parsers as IEEE 754 not-a-number, but it appears that Klaxon doesn't. I looked at the source code and I wasn't able to find a flag to enable that.

Is there any way to tell Klaxon to recognize NaN in input?

Is there a simple way to supply some additional function or something to the parser to tell it how to handle NaN?

Thank you for any light you can shed on this problem.

robert-dodier avatar Jan 17 '24 00:01 robert-dodier

FYI, NaN is not valid JSON, so no conformant JSON generator should be producing it. (It’s valid in JSON5, though.)

snej avatar Sep 14 '25 20:09 snej