Three Binary Tricks (opens in new tab)
I have been tinkering with non-database stuff recently and I don't really have any of it in a place to share something fun about. So in the interim, here is a small collection of some tricks I like a lot. I like bitwise tricks a lot. Here's a couple that are not particularly useful, but are fun and cool. If you like these, you should read Hacker's Delight. 1. Average of two numbers The problem with computing the average of two numbers in the obvious way: (a + b) / 2, is that a + b might overf...
Read the original article