switch to better method for getting floor(log2(double))