We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
double val = std::numeric_limits::quiet_NaN(); DBG << "val=" << val; json j = val; DBG << "j=" << j.dump(); val = j; DBG << "val=" << val;
goes like this:
val=nan j=null terminate called after throwing an instance of 'std::domain_error' what(): type must be number, but is null
Could this not be behave nicer?
The text was updated successfully, but these errors were encountered:
With the code in the develop branch, this works:
develop
int main() { double val = std::numeric_limits<double>::quiet_NaN(); std::cout << "val=" << val << std::endl; json j = val; std::cout << "j=" << j.dump() << std::endl; val = j; std::cout << "val=" << val << std::endl; }
output:
val=nan j=null val=nan
Note the develop branch is unreleased and is subject to changes until version 3.0.0. This behavior of NaN was only introduced recently.
Sorry, something went wrong.
@martukas Did you try the develop branch? Could you comment on this?
No branches or pull requests
double val = std::numeric_limits::quiet_NaN();
DBG << "val=" << val;
json j = val;
DBG << "j=" << j.dump();
val = j;
DBG << "val=" << val;
goes like this:
val=nan
j=null
terminate called after throwing an instance of 'std::domain_error'
what(): type must be number, but is null
Could this not be behave nicer?
The text was updated successfully, but these errors were encountered: