Skip to content

NaN to json and back #515

Closed
Closed
@martukas

Description

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?

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions