Merge pull request #339 from Dani-Hub/master

Floating-point NaN or Infinity values should be allowed as a feature …
This commit is contained in:
Christopher Dunn
2015-09-05 11:59:54 -05:00
parent a7b80fea65
commit a4354d782b
5 changed files with 205 additions and 44 deletions

View File

@@ -277,6 +277,9 @@ public:
the JSON value in the input string.
- `"rejectDupKeys": false or true`
- If true, `parse()` returns false when a key is duplicated within an object.
- `"allowSpecialFloats": false or true`
- If true, special float values (NaNs and infinities) are allowed
and their values are lossfree restorable.
You can examine 'settings_` yourself
to see the defaults. You can also write and read them just like any

View File

@@ -99,6 +99,10 @@ public:
Strictly speaking, this is not valid JSON. But when the output is being
fed to a browser's Javascript, it makes for smaller output and the
browser can handle the output just fine.
- "useSpecialFloats": false or true
- If true, outputs non-finite floating point values in the following way:
NaN values as "NaN", positive infinity as "Infinity", and negative infinity
as "-Infinity".
You can examine 'settings_` yourself
to see the defaults. You can also write and read them just like any