Search code examples
bitbit-shift

What are some good resources for learning bit shifting?


I'd like to add some real bit shifting skills to my toolkit. What are some good resources?

I'm aiming for fluency; I want to be able to think in bit shifting patterns the same way I think in memos or maps or folds or recursion.


Solution

  • The "standard" resources for bit manipulations are

    • the website Bit Twiddling Hacks by Sean Eron Anderson, and
    • the book Hacker's Delight by Henry S. Warren Jr. (full, but malformed scan available here).

    Those won't teach you directly how to come up with solutions on your own, but this is normal for learning. Look at the examples there and learn from them.