c.***********@gmail.com wrote:
suppose
int a=4;
int prod1=17*a;
(We must be inside a function.)
int prod2=a<<4+a; //another way of implementing 17*a
Is there any problem with prod2..?
Even if it's fixed as vippstar or Zhao note elsethread, the problem
with `prod2` is that it's not clear what's going on. The Horse! Why
shift-and-add when you can multiply by 17 and have the compiler sort
things out?
--
"We dance, and the worlds melt away." - Curved Air, /Metamorphosis/
Hewlett-Packard Limited registered no:
registered office: Cain Road, Bracknell, Berks RG12 1HN 690597 England