Forums Register Login

Confusion in Shift (edit: 1.4 topic)

+Pie Number of slices to send: Send
128 >>> 2
128 >> 2

-128 >>> 2
-128 >> 2

How the above four will be different? I have great confusion in understanding right shift signed and unsigned operators. Can anybody pls explain it for me?
[ November 25, 2006: Message edited by: Bert Bates ]
+Pie Number of slices to send: Send
128 >>> 2
with sign
128 >> 2
without sign

abv 2 won have diff

-128 >>> 2
with sign


-128 >> 2
without sign

in the case of >>> MSB will also get shifted
0 is the msb in case of positive numbers
and 1 for negative numbers
+Pie Number of slices to send: Send
rmember ranchers - this topic is only on the 1.4 exam, it's NOT on the 5.0 exam!
Wink, wink, nudge, nudge, say no more, it's a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 488 times.
Similar Threads
Shift operators
Whats the output
About unsigned right shift operator
shift operators
operators
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:39:29.