assistance-engine/docs/developer.avapframework.com/chapter9_25.md

12 lines
474 B
Markdown

## Shift Operations
Shift operations have lower precedence than arithmetic operations:
```javascript
shift_expr ::= a_expr | shift_expr ("<<" | ">>") a_expr
```
These operators accept integers as arguments. They shift the first argument left or right by the number of bits specified by the second argument.
A right shift by `n` bits is defined as an integer floor division by `pow(2, n)` . A left shift by `n` bits is defined as a multiplication by `pow(2, n)` .