Skip to content
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

Improve number-to-string conversion #1334

Closed
nlohmann opened this issue Nov 3, 2018 · 3 comments
Closed

Improve number-to-string conversion #1334

nlohmann opened this issue Nov 3, 2018 · 3 comments
Labels
kind: enhancement/improvement state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated

Comments

@nlohmann
Copy link
Owner

nlohmann commented Nov 3, 2018

The dump_integer function is naive custom code and the dump_float function uses a Grisu2 implementation. This leaves a lot of room for improvements.

In C++17, we could use <charconv>'s std::to_chars as pointed out by u/STL and live happily ever after. Unfortunately, we are still sticking around with C++11.

Examples for code to try are:

Maybe there are other projects, too.

It would be great to try different implementations. The largest piece of work should usually be to make it run as single header, and to adjust it to the interface.

@stale
Copy link

stale bot commented Dec 3, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Dec 3, 2018
@stale stale bot closed this as completed Dec 10, 2018
@nlohmann nlohmann reopened this Jan 13, 2019
@stale stale bot removed the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Jan 13, 2019
@nlohmann
Copy link
Owner Author

#1411 tackled the integer part.

@stale
Copy link

stale bot commented Feb 12, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Feb 12, 2019
@stale stale bot closed this as completed Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement/improvement state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated
Projects
None yet
Development

No branches or pull requests

1 participant