Forums Register Login

Bit Shifting question

+Pie Number of slices to send: Send
hi, thank you for reading

i have a question which deal with bit shifting


x=1 ==> 0000 0000 0000 0000 0000 0000 0000 0001

my question is, let say right shift x to 31 bits, will the bit shift after the rightmost bit and then will continue the shift from leftmost ?

after right shift to 31 bits, would it be 0000 0000 0000 0000 0000 0000 0000 0010 ?
+Pie Number of slices to send: Send
 

my question is, let say right shift x to 31 bits, will the bit shift after the rightmost bit and then will continue the shift from leftmost ?


You are describing a right circular shift. Java does not do this. Bits shifted past the end of a word go into the bit bucket, where they will be reused the next time you reboot your computer.
+Pie Number of slices to send: Send
mike, thanks for answering , based on


can you please clarify further details? what do you means bit bucket ? and how could it be reuse during enxt time reboot the computer ?
+Pie Number of slices to send: Send
 

Originally posted by Alvin chew:
can you please clarify further details? what do you means bit bucket ? and how could it be reuse during enxt time reboot the computer ?



Alvin,

A "bit bucket" is slang for thrown away. A.K.A. "/dev/null", "round file", "trash can", etc...

Mike,

Maybe you should add a ... You never know when jokes may be taken seriously.

Henry
+Pie Number of slices to send: Send
sorry for misunderstanding
Seriously Rick? Seriously? You might as well just read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 658 times.
Similar Threads
Shift operators !
i don't get shift operators!!!!
Bit Shifting
Dans Question -Operators
How this output is coming regarding left shift operator
More...

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