links: [[Elixir MOC]]
---
Bitwise binary functions[^1] can be performed on integers using the [Bitwise module](https://hexdocs.pm/elixir/Bitwise.html)
- `band/2`: bitwise AND
- `bsl/2`: bitwise SHIFT LEFT
- `bsr/2`: bitwise SHIFT RIGHT
- `bxor/2`: bitwise XOR
- `bor/2`: bitwise OR
- `bnot/1`: bitwise NOT
```elixir
Bitwise.band(0b1110, 0b1001)
# => 8 # 0b1000
Bitwise.bxor(0b1110, 0b1001)
# => 7 # 0b0111
```
---
tags: #bit-manipulation
sources:
[^1]: https://en.wikipedia.org/wiki/Bitwise_operation