-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Add missing testcase about NaN in unit-constructor1.cpp #2043
Conversation
test/src/unit-constructor1.cpp
Outdated
|
||
// check round trip of NaN | ||
json::number_float_t d = j; | ||
CHECK(d == n); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently, comparing NaNs with ==
does not work, hence all CI builds fail. Please check https://stackoverflow.com/questions/15268864/how-to-compare-two-nan-values-in-c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll close this. Thanks for reminding : )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not mean to close this - maybe
CHECK(std::is_nan(d) and std::is_nan(n));
would also do the job?
a8beddb
to
bb1843b
Compare
bb1843b
to
c379d02
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thanks! |
🔖 Release itemThis issue/PR will be part of the next release of the library. This template helps preparing the release notes. Type
Description
|
[Describe your pull request here. Please read the text below the line, and make sure you follow the checklist.]
Pull request checklist
Read the Contribution Guidelines for detailed information.
include/nlohmann
directory, runmake amalgamate
to create the single-header filesingle_include/nlohmann/json.hpp
. The whole process is described here.