# Numeric complements

This online calculator calculates radix complement and diminished radix complement for given number and radix.

This content is licensed under Creative Commons Attribution/Share-Alike License 3.0 (Unported). That means you may freely redistribute or modify this content under the same license conditions and must attribute the original author by placing a hyperlink from your site to this work https://planetcalc.com/8574/. Also, please do not modify any references to the original work (if any) contained in this content.

This online calculator calculates **radix complement** (referred to as **r's complement**) and **diminished radix complement** (referred to as **(r-1)'s complement**) for the given number and the given radix (base).

### Complement numbers

A complement number is a number that, when added to its counterpart, makes some other number, usually a base (radix) of a number system. In such a case, it is called **radix complement**. For example, 7 complements 3 to 10.

By definition, the formula of the radix complement of an *n* digit number *y* in radix *b* is

There is also a **diminished radix complement**, which is

.

Diminished radix complement is easy to get by simply replacing the digits of a number with digits needed to get *radix - 1*. For example, for the 2 digit decimal number *56*, the diminished radix complement is *43*. Then you can get radix complement by simply adding the one to the diminished radix complement: *43+1=44*

For the decimal system, a radix complement is known as **ten's complement** (**10's complement**), and diminished radix complement is known as nines' complement (**9's complement**).

Generally, complements are used to represent a symmetric range of positive and negative integers. In other words, half of the range represents positive numbers, and their complements represent negative numbers. That is, for ten's complement, if we consider only one digit, i.e., range from 0 to 9, *3* represents *+3*, and *7* represents *-3*.

This allows technique known as **method of complements**, where you can calculate subtraction as addition of subtrahend complement, f.e. *622 - 451* is *622 + 549 = 1171 = 171* (the leading 1 is omitted from the result).

For the binary system radix complement is known as **two's complement** (**2's complement**) and diminished radix complement as **one's complement** (**1's complement**). One's complement can be obtained by simply inverting bits of a number. Two's complement is used in computers to represent negative integers. You can read more here: Binary, inverse and complement codes.

## Comments