Right shift operator
The right shift operator >> produces its result by moving the left operand value’s bit to the right. The vacated bits on the left are filled with 0 bits if the left operand value is zero or positive and filled with 1 bits if the left operand value is negative. Bits that are moved to beyond the rightmost bit (the least significant bit) position are discarded.
Examples
The following tables illustrate this using 64-bit binary values.
i := 42; | 0000000000000000000000000000000000000000000000000000000000101010 |
i >> 24 | 0000000000000000000000000000000000000000000000000000000000000000 |
i := -42; | 1111111111111111111111111111111111111111111111111111111111010110 |
i >> 24 | 1111111111111111111111111111111111111111111111111111111111111111 |
Copyright © 2013
Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.