Just when you thought the blog could get no geekier - it does.
Q: How do you determine if an integer is a power of two simply by looking at it's bits?
A: f = !(v & (v - 1)) && v;
I love C.
Here's a page full of them: Bit Twiddling Hacks
That's all for now.
Thursday, April 06, 2006
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment