Is there any sequence of left shift and right shift operators that can divide or multiply a number by a number that is not a multiple of 2 i.e. can we multiply a number by 11 using a sequence of left shift and right shift operators .
SpS
34
Posting Pro
Recommended Answers
Jump to PostYes, you can simulate multiplication by non-powers-of-two with shifting and adding. For example, 11 = 8 + 2 + 1, you can build up from that.
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.