Shift Operations
| Operator | Description |
|---|---|
a << n | Left shift (multiply by $2^n$) |
a >> n | Right shift (floor divide by $2^n$) |
var x = BInt(1)
print(x << 100) # 1267650600228229401496703205376 (= 2^100)
print(BInt(1024) >> 5) # 32
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
| Operator | Description |
|---|---|
a << n | Left shift (multiply by $2^n$) |
a >> n | Right shift (floor divide by $2^n$) |
var x = BInt(1)
print(x << 100) # 1267650600228229401496703205376 (= 2^100)
print(BInt(1024) >> 5) # 32