<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56261>56261</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc++] std::to_chars precision loss for 80-bit long double
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
alvinhochun
</td>
</tr>
</table>
<pre>
`std::to_char` in libc++ converts `long double` to `double`: https://github.com/llvm/llvm-project/blob/3c126d5fe468e703ee3eacfcfc3641879b4fb281/libcxx/src/charconv.cpp#L81-L83
Test shows libc++ `std::to_char` output being different from `printf`/`std::ostream`, and compared to libstdc++: https://godbolt.org/z/Mfa6TE3rv
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVUclu3DAM_Rr7IsxAlsbbwYekaU7JLfdCC22rkE1DkidJv76Uu2RQtIdClEWK8uN7pEb7PhQNj8kW8o4s4Rczq0BXzK3MO20KcU_GDK5XCCkySnlcJ2Zx1x7yw4T58ndMKGxOaYsZUTySTS7Nuz4bXCjw_vrrOG0Bv4JJFGqPmg5pKtHYeoRL00HLJYAEZUZasrlUXdvry6hFV2UA4vb2Rk4MxPExs84cz2bbCiGfuur01MmCPxT87sf3BWJiccbXeKvrH-JxT9uemAaXpbpxhABrYmPAJf-yBbemMYslgTcIGFMAtRyJT0ytlvq2bCqAzV2isvTyZ-W_tAmtRp_OGCaKvtF-HlXz8lmGa2kHaXvZqzK55GEo6vsPDUX9wP7UENkWwLjokKaIMbIRA-v4SbvEbsZX7sEP_z0sF-MOkZy6EU1VzoM1nVHVKJSl-bUAleWdgVYIYxthjSq90uBjpl0IscIrOyDIJ-6lGwQXgjei450UVX0Gy2Vv29pUbdWL3hYXDoty_px55PaUYTgo6X2KlPQupviRVDG6aYWjSxlf7WnGMCh_deuMZt7X8ig_HPS_A3v68vk">