This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes Two's complement significance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Two Watch "Two New topic
Author

Two's complement significance

Sridevi Shrikanth
Ranch Hand

Joined: Jan 11, 2001
Posts: 31
What is the significance of representing number in two's complement?
Steve Fahlbusch
Bartender

Joined: Sep 18, 2000
Posts: 595
    
    7

It allows for all bits to be represented while eliminating the embarrassing problem of having a positive and negative zero.
for example: an 8 bit number allows values of -128 to 127.

[This message has been edited by Steve Fahlbusch (edited January 23, 2001).]
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

Steve is correct.
For more discussion on this please refer to a past
discussion
and also a discussion on Signed and Unsigned numbers - which elaborates the discussion.
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
Have you checked out Aspose?
 
subject: Two's complement significance
 
It's not a secret anymore!