File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the difference between >> and >>>

 
saikrishna cinux
Ranch Hand
Posts: 689
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am running a sample program for using bitwise operators





these 2 statements give the same o/p :roll:

then what might be the difference?
 
Keith Lynn
Ranch Hand
Posts: 2399
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will only see the difference if you try shifting a negative number.

Remember that the first bit in a negative number is 1.

>> is a right-shift operator that will keep a negative number negative. That is, a 1 will be shifted in.

>>> is an unsigned right-shift operator that will shift a 0 in and not a 1.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic