nlohmann / json

JSON for Modern C++
https://json.nlohmann.me
MIT License
42.18k stars 6.65k forks source link

Fix for printing long doubles bug in dump_float #3929

Open RUSLoker opened 1 year ago

RUSLoker commented 1 year ago

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.

github-actions[bot] commented 1 year ago

🔴 Amalgamation check failed! 🔴

The source code has not been amalgamated. @RUSLoker Please read and follow the Contribution Guidelines.

github-actions[bot] commented 1 year ago

🔴 Amalgamation check failed! 🔴

The source code has not been amalgamated. @RUSLoker Please read and follow the Contribution Guidelines.

github-actions[bot] commented 1 year ago

🔴 Amalgamation check failed! 🔴

The source code has not been amalgamated. @RUSLoker Please read and follow the Contribution Guidelines.

coveralls commented 1 year ago

Coverage Status

coverage: 100.0%. remained the same when pulling cf5c7fbba9cf1eedaff4a61845e74a27fd6e39c8 on RUSLoker:patch-1 into a259ecc51e1951e12f757ce17db958e9881e9c6c on nlohmann:develop.

t-b commented 1 year ago

I think a test is missing or?

nlohmann commented 1 year ago

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.

nlohmann commented 1 year ago

Please update to recent develop version - the CI is fixed there (see #3906).

RUSLoker commented 1 year ago

@nlohmann, it asks for your approval to run CI workflows.

RUSLoker commented 1 year ago

@nlohmann, @gregmarr, what's wrong with Cirrus CI / check?

nlohmann commented 1 year ago

@nlohmann, @gregmarr, what's wrong with Cirrus CI / check?

Looks like a glitch.

nlohmann commented 7 months ago

Any update on this? Tests are still missing.