operator >> abstract method Null safety
- int shiftAmount
Shift the bits of this integer to the right by shiftAmount
.
Shifting to the right makes the number smaller and drops the least
significant bits, effectively doing an integer division by
pow(2, shiftAmount)
.
It is an error if shiftAmount
is negative.
Example:
print((3 >> 1).toRadixString(2)); // 0011 -> 0001
print((9 >> 2).toRadixString(2)); // 1001 -> 0010
print((10 >> 3).toRadixString(2)); // 1010 -> 0001
print((-6 >> 2).toRadixString); // 111...1010 -> 111...1110 == -2
print((-85 >> 3).toRadixString); // 111...10101011 -> 111...11110101 == -11
Implementation
int operator >>(int shiftAmount);