版本2和3间的区别
于2007-07-19 07:35:33修订的的版本2
大小: 935
编辑: czk
备注:
于2008-02-23 15:35:55修订的的版本3
大小: 935
编辑: localhost
备注: converted to 1.6 markup
未发现区别!

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.