Re: [algogeeks] Re: complement

2011-09-18 Thread Arun Vishwanathan
Thanks Dave , appreciate it On Sun, Sep 18, 2011 at 7:15 PM, Dave wrote: > @Arun: This is the way two's complement arithmetic works. For any x, - > x = ~x + 1. This says that to negate a number, complement it and add > 1. > > Technically speaking, two's complement is a "weighted code." Each bit

[algogeeks] Re: complement

2011-09-18 Thread Dave
@Arun: This is the way two's complement arithmetic works. For any x, - x = ~x + 1. This says that to negate a number, complement it and add 1. Technically speaking, two's complement is a "weighted code." Each bit position has a certain weight that is added in if the bit in that position is a 1. Co