From 8c2445a565dc810cf8fd8d36a4d0e27e6cc6da34 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Sun, 14 Jun 2026 18:58:02 +0200 Subject: [PATCH] P3505R4 Fix the default floating-point representation in std::format Editorial note: Inserted "than" into "{larger,smaller} than or equal to". --- source/support.tex | 2 +- source/text.tex | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/source/support.tex b/source/support.tex index 6c0e9657e1..af1c329f0b 100644 --- a/source/support.tex +++ b/source/support.tex @@ -868,7 +868,7 @@ #define @\defnlibxname{cpp_lib_three_way_comparison}@ 201907L // freestanding, also in \libheader{compare} #define @\defnlibxname{cpp_lib_to_address}@ 201711L // freestanding, also in \libheader{memory} #define @\defnlibxname{cpp_lib_to_array}@ 201907L // freestanding, also in \libheader{array} -#define @\defnlibxname{cpp_lib_to_chars}@ 202306L // also in \libheader{charconv} +#define @\defnlibxname{cpp_lib_to_chars}@ 202606L // also in \libheader{charconv} #define @\defnlibxname{cpp_lib_to_string}@ 202306L // also in \libheader{string} #define @\defnlibxname{cpp_lib_to_underlying}@ 202102L // freestanding, also in \libheader{utility} #define @\defnlibxname{cpp_lib_transformation_trait_aliases}@ 201304L // freestanding, also in \libheader{type_traits} diff --git a/source/text.tex b/source/text.tex index 549d6f32e0..1413367668 100644 --- a/source/text.tex +++ b/source/text.tex @@ -174,13 +174,18 @@ \begin{itemdescr} \pnum \effects +Let \tcode{T} be \tcode{\placeholder{floating-point-type}}. \tcode{value} is converted to a string in the style of \tcode{printf} in the \tcode{"C"} locale. -The conversion specifier is \tcode{f} or \tcode{e}, -chosen according to the requirement for a shortest representation -(see above); -a tie is resolved in favor of \tcode{f}. +The conversion specifier is \tcode{f} if +the absolute value of \tcode{value} is in the range \range{$l$}{$u$}, where +$l$ is the smallest value larger than or equal to $10^{-4}$ +that is representable by \tcode{T} and +$u$ is the largest value smaller than or equal to +$\tcode{std::numeric_limits::radix}^{\tcode{std::numeric_limits::digits + 1}}$ +rounded down to the nearest power of 10 representable by \tcode{T}, +otherwise \tcode{e}. \pnum \throws