Skip to content

Floating point rounding #777

@quicknir

Description

@quicknir

I'll preface this by saying I know there's been some discussion about this already, and by saying that my version is not the latest, so this may already be fixed. Right now, you can do:

auto j = json::parse(R"({"x":1.5})");
int x = j.at("x");

With no complaint. Is this intentional? I thought that json checks to see if precision is lost before converting to an integer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: please discussplease discuss the issue or vote for your favorite optionstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updated

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions