aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaul Dreik <gccpatches@pauldreik.se>2023-08-14 15:42:33 +0100
committerJonathan Wakely <jwakely@redhat.com>2023-08-14 18:10:28 +0100
commit2d2b05f0691799f03062bf5c436462f14cad3e7c (patch)
tree856b1ac16da30f801ee2e9511339ebca003fbced /gcc
parent882af290c137dfab5d99b88e6dbecc5e75d85a0b (diff)
downloadgcc-2d2b05f0691799f03062bf5c436462f14cad3e7c.zip
gcc-2d2b05f0691799f03062bf5c436462f14cad3e7c.tar.gz
gcc-2d2b05f0691799f03062bf5c436462f14cad3e7c.tar.bz2
libstdc++: Avoid problematic use of log10 in std::format [PR110860]
If abs(__v) is smaller than one, the result will be of the form 0.xxxxx. It is only if the magnitude is large that more digits are needed before the decimal dot. This uses frexp instead of log10 which should be less expensive and have sufficient precision for the desired purpose. It removes the problematic cases where log10 will be negative or not fit in an int. Signed-off-by: Paul Dreik <gccpatches@pauldreik.se> libstdc++-v3/ChangeLog: PR libstdc++/110860 * include/std/format (__formatter_fp::format): Use frexp instead of log10.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions