1
vote
1answer
221 views

Next power of 2 for a number (in search for better “bit-twiddling” way)

I just wonder if there exists better (i.e. faster?) way to get the next power of 2 for a given number than the following one (maybe some better sort of "bit-twiddling" hack is possible?) ... static ...
29
votes
13answers
2k views

How good does a well-rounded programmer need to be with bit-wise operations? [closed]

I have been browsing some OpenJDK code recently and have found some intriguing pieces of code there that has to do with bit-wise operations. I even asked a question about it on StackOverflow. ...