Skip to content

NaN to json and back #515

Description

@martukas

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions