aspose file tools*
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: 562
    
    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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Two's complement significance