-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Fix for printing long doubles bug in dump_float #3929
base: develop
Are you sure you want to change the base?
Conversation
When you use long double as a floating point type with the current version of this file and try to dump json it prints trash instead of actual number. This if-else fixes the problem. On using long double you just need to add an 'L' modifier before 'g' in format string.
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @RUSLoker Please read and follow the Contribution Guidelines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The library targets C++11. Please adjust the code.
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @RUSLoker Please read and follow the Contribution Guidelines. |
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @RUSLoker Please read and follow the Contribution Guidelines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @nlohmann will need to merge.
I think a test is missing or? |
Yes, a test is definitely required. There is also #3906 that I need to take care of to finally have a green CI again. I'm busy right now, so sorry for delays. |
Please update to recent develop version - the CI is fixed there (see #3906). |
@nlohmann, it asks for your approval to run CI workflows. |
@nlohmann, @gregmarr, what's wrong with Cirrus CI / check? |
Looks like a glitch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests.
Any update on this? Tests are still missing. |
Please update to the latest develop branch and add a test. |
When you use long double as a floating point type with the current version of include/nlohmann/detail/output/serializer.hpp and try to dump json it prints trash instead of actual number. This if-else fixes the problem. On using long double you just need to add an 'L' modifier before 'g' in format string.