Skip to content
HTQHow To Quant
← Problem Bank

Multiplication by 7

CalcEasy~10 min· Algorithms
Problem

Multiply an integer by using only bit shifts and a single subtraction (no * operator, no loops).

Generalise: how would you multiply by any constant using shifts and adds/subtracts?