Skip to content

Floating-point NaN or Infinity values should be allowed as a feature … #339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 5, 2015

Conversation

Dani-Hub
Copy link
Contributor

@Dani-Hub Dani-Hub commented Sep 3, 2015

#209

Introduce 'allowSpecialFloats' for readers and 'useSpecialFloats' for writers, use consistent macro snprintf definition for writers and readers, provide new unit tests for #209

…pen-source-parsers#209

Introduce 'allowSpecialFloats' for readers and 'useSpecialFloats' for writers, use consistent macro snprintf definition for writers and readers, provide new unit tests for open-source-parsers#209
…pen-source-parsers#209

Introduce 'allowSpecialFloats' for readers and 'useSpecialFloats' for writers, use consistent macro snprintf definition for writers and readers, provide new unit tests for open-source-parsers#209
@cdunn2001
Copy link
Contributor

I like this change. It seems good as-is. But I do have one idea: NaN/Infinity/-Infinity are just conventions, right? They could be any 3 strings. We could use something easier to parse, like _NaN/_PosInfinity/_NegInfinity. But I guess this is really for Javascript, yes?

@Dani-Hub
Copy link
Contributor Author

Dani-Hub commented Sep 4, 2015

They are "just" conventions, but they are very popular ones, as described in the rationale of my issue #209. Please don't change these values lightheartedly, since doing that would break compatibility to gson, json5, simplejson, and probably several other json libraries.

@BillyDonahue
Copy link
Contributor

FYI: I did a little more testing and found a parsing bug.
Dani-Hub#2

@Dani-Hub
Copy link
Contributor Author

Dani-Hub commented Sep 5, 2015

Thanks for bug-finding test, Billy! The revised implementation should honor you test cases now properly.

@cdunn2001
Copy link
Contributor

I'll try to cherry-pick this to 0.y.z too, but that's probably not a big deal.

cdunn2001 added a commit that referenced this pull request Sep 5, 2015
Floating-point NaN or Infinity values should be allowed as a feature …
@cdunn2001 cdunn2001 merged commit 3ee15b7 into open-source-parsers:master Sep 5, 2015
cdunn2001 added a commit to cdunn2001/jsoncpp that referenced this pull request Sep 5, 2015
Floating-point NaN or Infinity values should be allowed as a feature …
cdunn2001 added a commit that referenced this pull request Sep 5, 2015
Merge pull request #339 from Dani-Hub/master
@cdunn2001 cdunn2001 mentioned this pull request Sep 23, 2015
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants