Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
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
Forum:
Programmer Certification (OCPJP)
doubt in bitwise operator
Muthuvel Ramamoorthy
Greenhorn
Posts: 20
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
Could any one help in understanding the following.
-11^12 = -7
-7&7 = 1
Thanks in advance.
joshua antony
Ranch Hand
Posts: 117
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
2's complement of -7 is 1...11001
So -7 & 7 means
1...11001 (32 bits since integer)
0...00111 (32 bits since integer)
----------------
0...00001 which is equal to decimal 1
-----------------
Ashish Shirbhate
Greenhorn
Posts: 8
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
2's complement of -11 is 10011001
10000101
XOR
00001100
-------------
10001001 which is -7
wise owen
Ranch Hand
Posts: 2023
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
11110101 (-11)
XOR
00001100 (12)
------------
11111001 (-7)
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Your lucky number
lucky number
when 400 mark will reach?
count yourself in javaranch#~
JAVA 7 launching on 7/7/2011
More...