Title
Rephrase ones' complement using base-2 representation
Status
open
Section
7.6.2.2 [expr.unary.op]
Submitter
Jim X

Created on 2022-09-10.00:00:00 last changed 2 weeks ago

Messages

Date: 2022-09-10.07:17:47

Suggested resolution:

Subclause 7.6.2.2 [expr.unary.op] paragraph 10 specifies:

The operand of ~ shall have integral or unscoped enumeration type; the result is the ones' complement of its operand. Integral promotions are performed. The type of the result is the type of the promoted operand. Given the coefficients xi of the base-2 representation (6.8.2 [basic.fundamental]) of the promoted operand x, the coefficient ri of the base-2 representation of the result r is 1 if xi is 0, and 0 otherwise. There is an ambiguity in the grammar...
Date: 2022-09-10.00:00:00

Subclause 7.6.2.2 [expr.unary.op] paragraph 10 specifies:

The operand of ~ shall have integral or unscoped enumeration type; the result is the ones' complement of its operand. Integral promotions are performed. The type of the result is the type of the promoted operand. There is an ambiguity in the grammar...

This should be phrased in terms of the base-2 representation similar to bitwise-AND, instead of alluding to some bit representation by using the term "ones' complement".

History
Date User Action Args
2022-09-10 07:17:47adminsetmessages: + msg6933
2022-09-10 00:00:00admincreate