Skip to content

Commit d17fd4d

Browse files
committed
[format.string] Avoid duplicating the specification of '#' for integers.
Fix the specification for '#' being different for octal integers in the two places it's specified.
1 parent a870403 commit d17fd4d

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

source/utilities.tex

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19892,27 +19892,20 @@
1989219892
This option is only valid for arithmetic types other than
1989319893
\tcode{charT} and \tcode{bool}
1989419894
or when an integer presentation type is specified.
19895-
For integers,
19896-
when binary or hexadecimal output is used,
19897-
this option adds the respective prefix
19898-
\tcode{0b} (\tcode{0B}) or
19899-
\tcode{0x} (\tcode{0X})
19895+
For integral types,
19896+
the alternate form adds the
19897+
base prefix (if any) specified in \tref{format.type.int}
1990019898
to the output value.
19901-
For nonzero integers,
19902-
when octal output is used,
19903-
this option adds the prefix \tcode{0}
19904-
to the output value.
19905-
Whether the prefix is lower-case or upper-case
19906-
is determined by the case of the type format specifier.
19907-
For floating-point numbers
19899+
For floating-point types,
1990819900
the alternate form causes the result of the conversion
1990919901
to always contain a decimal-point character,
1991019902
even if no digits follow it.
1991119903
% FIXME: This is a weird place for this part of the spec to appear.
1991219904
Normally, a decimal-point character appears in the result of these
1991319905
conversions only if a digit follows it.
1991419906
In addition, for \tcode{g} and \tcode{G} conversions,
19915-
% FIXME: Are they normally?
19907+
% FIXME: Are they normally? What does this even mean? Reach into to_chars and
19908+
% alter its behavior?
1991619909
trailing zeros are not removed from the result.
1991719910

1991819911
\pnum
@@ -20000,13 +19993,14 @@
2000019993
\lhdr{Type} & \rhdr{Meaning} \\ \rowsep
2000119994
\tcode{b} &
2000219995
\tcode{to_chars(first, last, value, 2)};
20003-
% FIXME: This duplicates things we said earlier.
20004-
using the \tcode{\#} option with this type adds the prefix \tcode{0b} to the output.
19996+
\indextext{base prefix}%
19997+
the base prefix is \tcode{0b}.
2000519998
\\ \rowsep
2000619999
%
2000720000
\tcode{B} &
2000820001
The same as \tcode{b}, except that
20009-
the \tcode{\#} option adds the prefix \tcode{0B} to the output.
20002+
\indextext{base prefix}%
20003+
the base prefix is \tcode{0B}.
2001020004
\\ \rowsep
2001120005
%
2001220006
\tcode{c} &
@@ -20021,18 +20015,21 @@
2002120015
%
2002220016
\tcode{o} &
2002320017
\tcode{to_chars(first, last, value, 8)};
20024-
using the \tcode{\#} option with this type adds the prefix \tcode{0} to the output.
20018+
\indextext{base prefix}%
20019+
the base prefix is \tcode{0} if \tcode{value} is nonzero and is empty otherwise.
2002520020
\\ \rowsep
2002620021
%
2002720022
\tcode{x} &
2002820023
\tcode{to_chars(first, last, value, 16)};
20029-
using the \tcode{\#} option with this type adds the prefix \tcode{0x} to the output.
20024+
\indextext{base prefix}%
20025+
the base prefix is \tcode{0x}.
2003020026
\\ \rowsep
2003120027
%
2003220028
\tcode{X} &
2003320029
The same as \tcode{x}, except that
2003420030
it uses uppercase letters for digits above 9 and
20035-
the \tcode{\#} option adds the prefix \tcode{0X} to the output.
20031+
\indextext{base prefix}%
20032+
the base prefix is \tcode{0X}.
2003620033
\\ \rowsep
2003720034
%
2003820035
\tcode{n} &

0 commit comments

Comments
 (0)