16 lines
566 B
Markdown
16 lines
566 B
Markdown
## Binary Bitwise Operations
|
|
|
|
Each of the three binary bitwise operations has a different level of precedence:
|
|
|
|
```javascript
|
|
and_expr ::= shift_expr | and_expr "&" shift_expr
|
|
xor_expr ::= and_expr | xor_expr "^" and_expr
|
|
or_expr ::= xor_expr | or_expr "|" xor_expr
|
|
```
|
|
|
|
* The `&` operator produces the bitwise AND of its arguments, which must be integers.
|
|
|
|
* The `^` operator produces the bitwise XOR (exclusive OR) of its arguments, which must be integers.
|
|
|
|
* The `|` operator produces the bitwise OR (inclusive OR) of its arguments, which must be integers.
|