Skip to content

Commit 7df2b91

Browse files
authored
[std] Use $...$ around negative numbers, for proper minus signs (#4790)
1 parent 2a587c1 commit 7df2b91

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

source/expressions.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
a = ((a + b) + 32765);
105105
\end{codeblock}
106106
since if the values for \tcode{a} and \tcode{b} were, respectively,
107-
-32754 and -15, the sum \tcode{a + b} would produce an exception while
107+
$-32754$ and $-15$, the sum \tcode{a + b} would produce an exception while
108108
the original expression would not; nor can the expression be rewritten
109109
as either
110110
\begin{codeblock}
@@ -115,7 +115,7 @@
115115
a = (a + (b + 32765));
116116
\end{codeblock}
117117
since the values for \tcode{a} and \tcode{b} might have been,
118-
respectively, 4 and -8 or -17 and 12. However on a machine in which
118+
respectively, 4 and $-8$ or $-17$ and 12. However on a machine in which
119119
overflows do not produce an exception and in which the results of
120120
overflows are reversible, the above expression statement can be
121121
rewritten by the implementation in any of the above ways because the

source/iostreams.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3691,7 +3691,7 @@
36913691
\pnum
36923692
\returns
36933693
An estimate of the number of
3694-
characters available in the sequence, or -1.
3694+
characters available in the sequence, or $-1$.
36953695
If it returns
36963696
a positive value, then successive calls to
36973697
\tcode{underflow()}
@@ -3701,7 +3701,7 @@
37013701
extracted from the stream.
37023702
If
37033703
\tcode{showmanyc()}
3704-
returns -1, then calls to
3704+
returns $-1$, then calls to
37053705
\tcode{underflow()}
37063706
or
37073707
\tcode{uflow()}
@@ -6161,7 +6161,7 @@
61616161
is
61626162
\tcode{true},
61636163
calls
6164-
\tcode{os.rdbuf()->pubsync()}. If that function returns -1, sets \tcode{badbit} in
6164+
\tcode{os.rdbuf()->pubsync()}. If that function returns $-1$, sets \tcode{badbit} in
61656165
\tcode{os.rdstate()} without propagating an exception.
61666166
\end{itemdescr}
61676167

@@ -6770,7 +6770,7 @@
67706770
constructs a sentry object. If that object returns \tcode{true} when converted to a value of type \tcode{bool} the function
67716771
calls
67726772
\tcode{rdbuf()->pubsync()}.
6773-
If that function returns -1
6773+
If that function returns $-1$
67746774
calls
67756775
\tcode{setstate(badbit)}
67766776
(which may throw

source/numerics.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7962,7 +7962,7 @@
79627962

79637963
\pnum
79647964
\begin{example}
7965-
If the argument has the value -2,
7965+
If the argument has the value $-2$,
79667966
the first two elements of the result will be value-initialized\iref{dcl.init}; the third element of the result will be assigned the value
79677967
of the first element of the argument; etc.
79687968
\end{example}

source/regex.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3256,7 +3256,7 @@
32563256

32573257
\pnum
32583258
When class \tcode{regex_token_iterator} is used to enumerate a
3259-
single sub-expression with index -1 the iterator performs field
3259+
single sub-expression with index $-1$ the iterator performs field
32603260
splitting: that is to say it enumerates one sub-expression for each section of
32613261
the character container sequence that does not match the regular
32623262
expression specified.
@@ -3275,7 +3275,7 @@
32753275
\pnum
32763276
If the end of sequence is reached (\tcode{position} is equal to the end of
32773277
sequence iterator), the iterator becomes equal to the end-of-sequence
3278-
iterator value, unless the sub-expression being enumerated has index -1,
3278+
iterator value, unless the sub-expression being enumerated has index $-1$,
32793279
in which case the iterator enumerates one last sub-expression that contains
32803280
all the characters from the end of the last regular expression match to the
32813281
end of the input sequence being enumerated, provided that this would not be an
@@ -3455,7 +3455,7 @@
34553455
\tcode{position_iterator(a, b, re, m)}. If \tcode{position} is not an
34563456
end-of-sequence iterator the constructor sets \tcode{result} to the
34573457
address of the current match. Otherwise if any of the values stored
3458-
in \tcode{subs} is equal to -1 the constructor sets \tcode{*this} to a suffix
3458+
in \tcode{subs} is equal to $-1$ the constructor sets \tcode{*this} to a suffix
34593459
iterator that points to the range \range{a}{b}, otherwise the constructor
34603460
sets \tcode{*this} to an end-of-sequence iterator.
34613461
\end{itemdescr}
@@ -3531,7 +3531,7 @@
35313531
address of the current match.
35323532

35333533
\pnum
3534-
Otherwise, if any of the values stored in \tcode{subs} is equal to -1 and
3534+
Otherwise, if any of the values stored in \tcode{subs} is equal to $-1$ and
35353535
\tcode{prev->suffix().length()} is not 0 the operator sets \tcode{*this} to a
35363536
suffix iterator that points to the range \range{prev->suffix().first}{prev->suffix().second}.
35373537

0 commit comments

Comments
 (0)