Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

TLDR: 3a = (a << 1) + a


From the article:

> Multiplying a number by three is straightforward in binary: add the number to itself, shifted to the left one position. (As mentioned above, shifting to the left is the same as multiplying by two and is easy in hardware.) Unfortunately, using a simple adder is too slow.

So no, not really. In fact the entire point of article is arguably explaining why it is not that simple.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: