• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Shift and Logical operators

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I had a typo in the original link
Cat and Mouse Game with Bits
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic