Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ InTouch HMI

左シフト(SHL)、右シフト(SHR)

  • Last UpdatedOct 08, 2024
  • 1 minute read

SHL および SHR は、整数オペランドだけを使用する二項演算子です。演算子の左側の数量によって参照される 32 ビット ワードのバイナリ演算子は、演算子の右側の数量で指定されたビット位置の数だけ(右または左に)シフトされます。

桁あふれしたビットは切り捨てられます。シフトによって空いたビット位置にはゼロが補填されます。シフトは符号なしシフトです。

例 1

Attribute2=00000111(10進数7)の場合

次に操作を行います:

Attribute1 = Attribute2 SHL 3;

Results in:

Attribute1=00111000(小数点56)

例2

Attribute2=00001011(10進数11)の場合

次に操作を行います:

Attribute1 = Attribute2 SHR 2;

Results in:

Attribute1=00000010(10進数2)

In This Topic