Multiply by a constant with shifts
A left shift n << k computes . The constant can be written as a difference of two powers of two, so with non-negative integer exponents (two shifts and one subtraction). Find .
Show hints (2)+
- Write as a difference of two powers of two: the power just above is , and .
- So , ; add them.
Answer
Reveal answer →Final answer
8
Create a free account to see the full worked solution and track your progress.
Interview format: Numerical Reasoning Tests, Trading Aptitude Tests