• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Shift and Logical operators

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A) op1 >>> op2 means shift bits of op1 right by distance op2(unsigned). Can anybody explain this with an example. what does 'unsigned' mean here.
B) ~op2 indicates the operation bitwise complement has taken place. Can anybody explain this also with an example.
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read Cat and Mouse Game with Bits, it should answer your questions. If you still have trouble, let me know and I'll see if I can't clarify things more
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carl, I get this error when I go to your link.
Error: 404
Location: /campfire/StroyBits.jsp
JSP file "/home/vhost1/www.javaranch.com/vroot/html/campfire/StroyBits.jsp (No such file or directory)" not found
 
Lalitha S
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carl, I also get the same error as Tyler when I go to your link.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Lalitha, you wont be getting this error. Mean while u can reffer, Patrick Naughton' book on Java 2 , that has got a fine example. for a rule remember if a number x is positive ~x will be -(x+1) and if negative ~x will be +(x-1)
 
Lalitha S
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Finally I could get to the CAT AND MOUSE GAME WITH BITS. I could understand the shift and logical operators well.
Thanks.
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please note that The Java Ranch has a naming policy, described here and "Lalitha S" is not a valid name.
Please choose one which meets the requirements.
Thanks.
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I had a typo in the original link
Cat and Mouse Game with Bits
 
This tiny ad is guaranteed to be gluten free.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic