728 B
728 B
id | title | tags | created | |
---|---|---|---|---|
t127 | Bitwise_operators |
|
Saturday, April 20, 2024 |
Bitwise operators
In addition to mathematical, logical and comparison operators, there are bitwise operators. These operators execute conditions based on the actual bits of a value rather than the values that the bits are encoded to represent.
Bitwise operators are typically represented with single characters of existing
operators, e.g. &
instead of &&
:
Bitwise operation | Operator |
---|---|
AND | & |
OR | (single pipe) |
NOT | ~ |
An example of using the &
operator:
x =5
y = 3