Sunday, January 3, 2010

Give a fast way to multiply a number by 7

Multiply by 8 (left shift by 3 bits) and then subtract the number.
(x << 3) - x

0 comments:

Post a Comment