-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Any plan for libc++ to support std::from_chars for floating points? #92711
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
Comments
I understand it's frustrating. However this feature is a lot of work even adapting an existing algorithm requires quite a bit of effort. Thusfar nobody has volunteered to do the work. There is this WIP PR #91651 to use LLVM's libc implementation. I don't know which algorithm they use. IIRC it's one Lemire worked on so it might be fast float. Since we don't use bugs to track missing parts of our implementation I'm closing the issue. |
I really appreciate volunteers' efforts. The mentioned PR seems not complete yet (not having error handling), but I believe this will be solved in the near future. Great thanks to you all. |
Thanks!
That PR indeed not complete and it may take some time. It is the first time libc++ and libc are sharing code. So we're also looking how to do that. |
Hi! I'm still working on the proof of concept PR (I want to make sure all the tests pass) but I am hopeful that it's going to lead to a finished implementation before the end of the year. As for the algorithm it uses, it is primarily the one that Lemire worked on, I gave a talk on exactly how it works at the 2022 dev conference: https://www.youtube.com/watch?v=s-UjbTV8p6g |
GCC (since GCC12) uses https://github.com/fastfloat/fast_float for |
@philnik777 Looking forward to the implementation. We'll be able to benchmark!!! :-) |
Thanks for the ping. I actually wanted to reach out to you for your implementation, and then @michaelrj-google suggested using the LLVM libc implementation so we went for that. I'll be eager to see how the implementations compare performance-wise. |
I think that's 100% a good recommendation as far as I can tell. I'll be happier if we end up with competing implementations. :-) |
It may be frustrating to know c++17 feature isn't supported in the latest libc++ yet.
GCC 12 has partially adopted https://github.com/fastfloat/fast_float as its library implementation, is it possibly proper to adopt it in libc++?
The text was updated successfully, but these errors were encountered: