Skip to content

float precision #1384

Description

@vassilisw

When a float is dumped and becomes float again via json::parse, looses precision

    json jjj;
    jjj["f"] = 11.123456789;
    float f = json::parse(jjj.dump())["f"];
    std::cout << f << std::endl;

expected: 11.12345678..
getting: 11.1235

Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0

Is there any way to increase precision?

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

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions