• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bit shifting

 
Arsho, Ayan
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<code>
Hi all
Could some one explain why the result of
l >> 32 (where long l = 1) and i >> 32(where int i = 1) is different?
Thanks in advance
BTW i read somewhere that this forum is going to be closed soon after jan 1st 2002, is it true??
</code>
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi arsho,
A long has 64-bits and an int 32-bits so shifting bits with i>>32 wraps the bits.
Check out the Cat and Mouse Games with Bits tutorial for how bit-shifting works.

BTW i read somewhere that this forum is going to be closed soon after jan 1st 2002, is it true??

No. Someone is pulling your leg
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
Co-author Mike Meyers' Java 2 Certification Passport
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic