nearestPowerOfTwoAbove optimization