
25 Apr
2005
25 Apr
'05
4:31 p.m.
Steven Scholz wrote:
How about
a = b / 5;
?
Will that result in
a = (b >> 2) - b;
, i.e. still no division but only shift operations?
I must be missing something here, because as far as I can see, the shift/substract combination above does not yield the same result as dividing by 5.
Using b=40 for example:
b/5 -> 8 (b >> 2) - b -> -30
Udi