This post was very helpful when I tried to figure it out: https://dougallj.wordpress.com/2021/10/30/bit-twiddling-opti...
I could have used that during the hours I spent figuring it out!
I could have used that during the hours I spent figuring it out!