WorldQuant interview question

Implement a log2(n) method, add unit tests too.