版本1和2间的区别
于2007-07-18 22:33:11修订的的版本1
大小: 882
编辑: czk
备注:
于2007-07-19 07:35:33修订的的版本2
大小: 935
编辑: czk
备注:
删除的内容标记成这样。 加入的内容标记成这样。
行号 1: 行号 1:
## page was renamed from TCPL/A.7.8 Shift Operators

A.7.8 Shift Operators

The shift operators << and >> group left-to-right. For both operators, each operand must be integral, and is subject to integral the promotions. The type of the result is that of the promoted left operand. The result is undefined if the right operand is negative, or greater than or equal to the number of bits in the left expression's type.

  • shift-expression:
    • additive-expression

      shift-expression << additive-expression shift-expression >> additive-expression

The value of E1<<E2 is E1 (interpreted as a bit pattern) left-shifted E2 bits; in the absence of overflow, this is equivalent to multiplication by 2E2. The value of E1>>E2 is E1 right-shifted E2 bit positions. The right shift is equivalent to division by 2E2 if E1 is unsigned or it has a non-negative value; otherwise the result is implementation-defined.

TCPL/A.07.08_Shift_Operators (2008-02-23 15:35:55由localhost编辑)

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