Thursday, 2 August 2012

How to fast multiply a number by 7?

(num << 3)- num

This is same as

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

No comments:

Post a Comment