Skip to content

Commit 68653fc

Browse files
burblebeetkoeppe
authored andcommitted
CWG2626 Rephrase ones' complement using base-2 representation
1 parent 3f9de47 commit 68653fc

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

source/expressions.tex

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4672,11 +4672,17 @@
46724672
The type of the result is \keyword{bool}.
46734673

46744674
\pnum
4675-
\indextext{signed integer representation!ones' complement}%
46764675
\indextext{operator!ones' complement}%
4677-
The operand of \tcode{\~{}} shall have integral or unscoped enumeration type; the
4678-
result is the ones' complement of its operand. Integral promotions are
4679-
performed. The type of the result is the type of the promoted operand.
4676+
The operand of \tcode{\~{}} shall have integral or unscoped enumeration type.
4677+
Integral promotions are performed.
4678+
The type of the result is the type of the promoted operand.
4679+
% FIXME: [basic.fundamental]/p5 uses $x_i$; [expr] uses $\tcode{x}_i$.
4680+
Given the coefficients $\tcode{x}_i$
4681+
of the base-2 representation\iref{basic.fundamental}
4682+
of the promoted operand \tcode{x},
4683+
the coefficient $\tcode{r}_i$
4684+
of the base-2 representation of the result \tcode{r}
4685+
is 1 if $\tcode{x}_i$ is 0, and 0 otherwise.
46804686
There is an ambiguity
46814687
in the grammar when \tcode{\~{}} is followed by
46824688
a \grammarterm{type-name} or \grammarterm{decltype-specifier}.

0 commit comments

Comments
 (0)