Binary Operator
| Name | Description |
|---|---|
| & | bit operator and, bitwise and |
| >> | Shift the displacement operator right |
| << | Distance operator shift left |
| ^ | Bitwise XOR |
| | | bit operator or, bitwise or |
| ~ | unary operator, binary inversion |
Bit functions and operators are usually used with integer data types and cannot be directly applied to other data types, such as float, double, etc. That is, they need to be used with the BIGINT (64-bit integer) parameter and return the BIGINT value, so their maximum range is 64-bit. Non-BIGINT parameters are converted to BIGINT before performing the operation, and may be truncated in integer digits, for example, 10.6496 and -10.6496 may be truncated or rounded during conversion to the INT type.
Bit functions and operators allow binary string type arguments (BINARY, VARBINARY, and BLOB types) and return values of their same type, which enables them to accept arguments and produce return values greater than 64 bits. Non-binary string parameters are converted to BIGINT type.