]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Do not call log10(0.0) in std::format [PR110860]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 11 Aug 2023 17:10:29 +0000 (18:10 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 11 Aug 2023 17:20:48 +0000 (18:20 +0100)
commit9e33d71834416b7eddadae2b0f68e85f04cd0c7f
tree9788f08737983c7263cf0806c9441cfd1e9a5fba
parent20db5cab7a5ca9ac2928d10efca85e80a3d8630b
libstdc++: Do not call log10(0.0) in std::format [PR110860]

Calling log10(0.0) returns -inf which has undefined behaviour when
converted to an integer. We only need to use log10 for large values
anyway. If the value is zero then the larger buffer is only needed due
to a large precision, so we don't need to use log10 to estimate the
number of digits for the significand.

libstdc++-v3/ChangeLog:

PR libstdc++/110860
* include/std/format (__formatter_fp::format): Do not call log10
with zero values.
libstdc++-v3/include/std/format
This page took 0.059995 seconds and 5 git commands to generate.