一元算术运算符Unary Arithmetic Operators

+ 括号内的表达式前面的一元加运算符强制对包含的运算进行分组。The unary plus operator preceding an expression in parentheses forces the grouping of the enclosed operations. 它用于涉及多个结合的或可交换的二元运算符的表达式。It is used with expressions involving more than one associative or commutative binary operator. 操作数必须具有算法类型。The operand must have arithmetic type. 结果为操作数的值。The result is the value of the operand. 整型操作数将进行整型提升。An integral operand undergoes integral promotion. 结果的类型为提升后的操作数的类型。The type of the result is the type of the promoted operand.
- 算术求反运算符生成其操作数的负值（2 的补数）。The arithmetic-negation operator produces the negative (two's complement) of its operand. 操作数必须是整型值或浮点值。The operand must be an integral or floating value. 此运算符执行常用算术转换。This operator performs the usual arithmetic conversions.
`~` 按位求补（或按位“非”）运算符将产生其操作数的按位补数。The bitwise-complement (or bitwise-NOT) operator produces the bitwise complement of its operand. 操作数必须为整型。The operand must be of integral type. 此运算符执行常用算术转换；结果具有转换后的操作数的类型。This operator performs usual arithmetic conversions; the result has the type of the operand after conversion.
!! 如果其操作数为 true（非零），则逻辑求反（逻辑“非”）运算符将生成值 0；如果其操作数为 false (0)，则生成值 1。The logical-negation (logical-NOT) operator produces the value 0 if its operand is true (nonzero) and the value 1 if its operand is false (0). 结果具有 `int` 类型。The result has `int` type. 操作数必须是整型值、浮点值或指针值。The operand must be an integral, floating, or pointer value.

示例Examples

``````short x = 987;
x = -x;
``````

``````unsigned short y = 0xAAAA;
y = ~y;
``````

``````if( !(x < y) )
``````