Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

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

Floating-point precision conversion error #2876

Closed
5 tasks
ApacheWang opened this issue Jul 16, 2021 · 0 comments
Closed
5 tasks

Floating-point precision conversion error #2876

ApacheWang opened this issue Jul 16, 2021 · 0 comments

Comments

@ApacheWang
Copy link

What is the issue you have?

Please describe the steps to reproduce the issue.

  1. pls use this case to reproduce.
    std::string tmp = "{\n" " \"compareType\":0,\n" " \"feature\":100,\n" " \"id\":8,\n" " \"leftNodeID\":17,\n" " \"rightNodeID\":18,\n" " \"threshold\":[\n" " 0.2709993869\n" " ]\n" " }"; json js = json::parse(tmp); cout << js.dump() << endl;
  2. And the threshold change to 0.27099938690000003

Can you provide a small but working code example?

What is the expected behavior?

And what is the actual behavior instead?

Which compiler and operating system are you using?

  • Compiler: ___
  • Operating system: ___

Which version of the library did you use?

  • latest release version 3.9.1
  • other release - please state the version: ___
  • the develop branch

If you experience a compilation error: can you compile and run the unit tests?

  • yes
  • no - please copy/paste the error message below
Repository owner locked and limited conversation to collaborators Jul 16, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants