Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is this sentence right?

 
theMatrix
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In java,the value returned by >>> will never be negative as long as the value of the right operand is equal to or greater than 1.
 
Jyotsna Umesh
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think if you don't put any condition even then >>> would never return negative value, what do others have to say about this.
Jyotsna
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very true !
>>> always results in a positive no.
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, not true try this:
System.out.println(-20>>>32);
don't forget that for ints the shift is actually %32 and for longs it is %64.
Dave
by the way 'theMatrix' you might want to change your name before one of the bartenders says something about it.
[This message has been edited by Dave Vick (edited June 20, 2001).]
[This message has been edited by Dave Vick (edited June 20, 2001).]
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that I have ALREADY asked him to re-register. The clock is ticking. Soon someone will just kill the ID.
 
Jyotsna Umesh
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh yes, I was wrong, it was a silly mistake.
Jyotsna
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was something !
Thanks Dave !!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic