A.7.4.6 One's Complement Operator

The operand of the ~ operator must have integral type, and the result is the one's complement of its operand. The integral promotions are performed. If the operand is unsigned, the result is computed by subtracting the value from the largest value of the promoted type. If the operand is signed, the result is computed by converting the promoted operand to the corresponding unsigned type, applying ~, and converting back to the signed type. The type of the result is the type of the promoted operand.

TCPL/A.07.04.6_One's_Complement_Operator (2008-02-23 15:36:41由localhost编辑)

ch3n2k.com | Copyright (c) 2004-2020 czk.