The Old New Thing : When is x/2 different from x>>1?
The Old New Thing : When is x/2 different from x>>1? This is an interesting point. I always thought it was a good optimization. I never considered what the effect would be on negative numbers. The moral of the story is right though. Its always a better idea to write what you mean first and then fiddle around with various optimizations later when doing code reviews or something.
0 Comments:
Post a Comment
<< Home