-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[libc++] std::to_chars precision loss for 80-bit long double #56261
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
The original code was provided by Microsoft, on Windows |
Before this gets implemented properly, would it be better to delete the |
And when will libc++ support |
During review there were no objections and we already shipped this. So we can no longer remove it. There will be differences in some cases, but I'm not sure how often that happens in practice. I'm not even sure whether anybody still uses
It's on my todo list, however that list is rather long and this item doesn't have a high priority for me. So I don't expect to work on it this year. Maybe somebody else will pick it up before it's on the top of my list. |
Since we typically don't use the bug tracker for not implemented features I'm closing this. |
A very late "strong agree" with @alvinhochun's comment. That silent cast to double is an annoying "gotcha".
The 80 bit extended precision long doubles aren't that useful. But true IEEE float128 is available on some platforms, and that can be useful. |
std::to_char
in libc++ convertslong double
todouble
:llvm-project/libcxx/src/charconv.cpp
Lines 81 to 83 in 3c126d5
Test shows libc++
std::to_char
output being different fromprintf
/std::ostream
, and compared to libstdc++: https://godbolt.org/z/GsYfTTjq7The text was updated successfully, but these errors were encountered: