The ten's complement of a nonzero integer having at most
decimal digits is
. More generally, the radix
complement of
in base
is
.
Complement arithmetic permits subtraction to be performed by addition followed by
discarding a final carry.
Ten's Complement
See also
Base, Complement, RadixExplore with Wolfram|Alpha
References
Knuth, D. E. The Art of Computer Programming, Vol. 2: Seminumerical Algorithms, 3rd ed. Reading, MA: Addison-Wesley, 1998.Cite this as:
Weisstein, Eric W. "Ten's Complement." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/TensComplement.html