Talk:Method of complements
|
|
I never really heard about Ten's complement, Nine's complement etc. until today, so I am probably not the one to tidy up this article. I found a decent brief explanation (http://mathforum.org/library/drmath/view/55949.html) of them for anyone else who wants to try. Someone who's better at math, please give it a look. -- Wapcaplet 01:50, 7 Nov 2003 (UTC)
Part of the Nine's Complement section wasn't correct, so I posted a little note of what seems to be the solution. . . --Joeedh 08:56, 15 Sep 2004 (UTC)
- Thanks, though usually comments such as this (notes to other contributors) should not be visible in the article; to make such comments invisible in the article, yet visible in the edit window, you can surround them with HTML comment tags:
<!-- ... -->. I'm having trouble understanding what you mean by this comment, though. You mention that 873-100 does not give a correct answer (did you mean 773?): 100 complemented is 899; 873 + 899 = 1772; drop the initial "1", giving 772; add 1, giving the correct answer 773. If you meant that subtracting a number smaller than 100 produces a wrong answer, I don't think that's true either; for example, for 873-50, complement 50 = 949; 873 + 949 = 1822; drop the "1" = 822; add 1 to get 823, the correct answer. The first digit in the intermediate result will always be "1" (unless x < y, which is a special case discussed in the next section) so I see no difference between subtracting 1 from it, or removing it altogether - and it should always be dropped. -- Wapcaplet 18:27, 15 Sep 2004 (UTC)
- Must have been an error in my code implementation. I'm using it for a infinite-precision integer library for a C++ class. Thanks for the tip.
Nine's vs. nines'
I don't think "nines' complement" is correct. The system works by finding the complement of each digit with respect to a value of nine, and there need not be multiple nines involved. The nine's complement of 3, for instance, is 6. It works similarly to two's complement, which works by finding each digit's complement with respect to the value 2. If there are no objections within a few days, I will revert. -- Wapcaplet 18:11, 18 Nov 2004 (UTC)
Computers don't use two's complement for subtraction!
I removed the following statement:
- One practical application of the method of complements is for performing subtraction in a computer microprocessor which uses the binary numeral system. Binary computers typically employ the two's complement for the operation of subtraction.
Computers do use two's complement for representing numbers; it makes addition and subtraction of signed integers a lot easier. But they don't subtract by complementing and adding as described in this article; they subtract using subtraction circuitry. --Rick Sidwell 03:20, 8 Jun 2005 (UTC)
