Subramanya's Digital Garden

Recent Notes

  • Appendix A Exploring Further

    Jan 25, 2026

    • javascript
    • fundamentals
  • Appendix B Practice!

    Jan 25, 2026

    • javascript
    • fundamentals
  • YDK JS Chapter 1

    Jan 25, 2026

    • ydkjs
    • book
Home

❯

02_Areas

❯

Computer Science

❯

02_Programming

❯

Languages

❯

Elixir

❯

Bit Manipulation in Elixir

Bit Manipulation in Elixir

Jan 25, 20261 min read

  • bit-manipulation

links: Elixir MOC


Bitwise binary functions1 can be performed on integers using the Bitwise module

  • 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
Bitwise.band(0b1110, 0b1001) 
# => 8 # 0b1000
 
Bitwise.bxor(0b1110, 0b1001)
# => 7 # 0b0111

tags: bit-manipulation

sources:

Footnotes

  1. https://en.wikipedia.org/wiki/Bitwise_operation ↩


Graph View

Backlinks

  • Elixir MOC
  • GitHub
  • LinkedIn
  • Twitter