Search in shivacherukuri.tech@blogger.com

Monday, April 26, 2010

How to fast multiply a number by 7

How to fast multiply a number by 7?




Try


(num<<3 - num)


This is same as


num*8 - num = num * (8-1) = num * 7

--

No comments:

Post a Comment