11-09-2011, 04:16 PM
i=y=1;i<y; result:false (this makes sense to me)
11-09-2011, 04:32 PM
Have a look at
Left shift a << b
Shifts a in binary representation b (< 32) bits to the left, shifting in zeros from the right.
Sign-propagating right shift a >> b
Shifts a in binary representation b (< 32) bits to the right, discarding bits shifted off.
What results were you expecting?
All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
The << and >> are logical shift operators (left and respectively right); they are not arithmetical operators. That means your problem has nothing to do with the order of operations :)
11-09-2011, 04:57 PM
11-09-2011, 05:00 PM
I did not know what to expect. I just tried it and when i tried to figure it out my line of thought was something like this.
Now i see that it did interpret "<<" as something else.
I have no concept of what you just wrote but it helped me understand my question. Thank you!
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.