-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Improve number-to-string conversion #1334
Copy link
Copy link
Closed
Labels
kind: enhancement/improvementstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updatedthe issue has not been updated in a while and will be closed automatically soon unless it is updated
Metadata
Metadata
Assignees
Labels
kind: enhancement/improvementstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updatedthe issue has not been updated in a while and will be closed automatically soon unless it is updated
The
dump_integerfunction is naive custom code and thedump_floatfunction uses a Grisu2 implementation. This leaves a lot of room for improvements.In C++17, we could use
<charconv>'sstd::to_charsas 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.