Bitwise Operators
Bitwise operators allow you to manipulate the bits of one or more operands. The following are the types of bitwise operators:
The storage length of the expression is a key factor to be considered while performing a bitwise operation. The following are the data types supported for bitwise operations:
The following table describes the bitwise operators. Each bitwise operator can take only numeric values as its operands.
 
expression & expression
Expression is any valid expression containing the integer data type, which is transformed into a binary number for the bitwise operation.
~ expression
Expression is any valid expression containing the integer data type, which is transformed into a binary number for the bitwise operation. The tilde (~) cannot be used as part of a user-defined name.
expression | expression
Expression is any valid expression containing the integer data type, which is transformed into a binary number for the bitwise operation.
expression ^ expression
Expression is any valid expression containing the integer data type, which is transformed into a binary number for the bitwise operation. The circumflex (^) cannot be used as part of a user-defined name.
Truth Table
The following is the truth table for bitwise operations.