A radix, or base, is the number that determines the place values in a positional numeral system. In the standard case, the radix is an integer , and each position has a value times that of the position immediately to its right. Such a system uses digit values, conventionally . Decimal notation has radix ten, while binary notation has radix two. The choice of radix changes how a number is written, not the number itself.
Definition and place value
For an integer radix , a finite positional numeral represents the value
where each digit is an integer satisfying . The separator between the positions and is called the radix point; the decimal point is its base-ten instance.
For example,
whereas
The subscript identifies the radix and is conventionally written in decimal notation. It can be omitted when the base is clear from context. In every ordinary base , the numeral denotes the number .
The digit zero serves as a placeholder: , for example, distinguishes two hundreds and five units from two tens and five units. A minus sign normally indicates a negative number; it is not part of the digit set.
Apart from leading zeros, every nonnegative integer has a unique finite representation in a fixed integer base . Zero is conventionally written as a single zero.
Common radices
| Radix | Conventional name | Digit symbols | Typical uses |
|---|---|---|---|
| 2 | Binary | Digital logic and computer arithmetic | |
| 8 | Octal | – | Compact representation of binary data |
| 10 | Decimal | – | Everyday arithmetic and measurement |
| 12 | Duodecimal or dozenal | Twelve symbols, with conventions varying | Alternative numeral systems |
| 16 | Hexadecimal | –, usually A–F | Computer memory addresses and binary data |
| 60 | Sexagesimal | Historically varied | Babylonian mathematics and angular or time subdivisions |
A radix specifies digit values, not necessarily particular printed symbols. In hexadecimal, A through F conventionally represent values ten through fifteen. In systems with larger bases, a single digit value may be written using a group of symbols.
Decimal notation is the basis of the Hindu–Arabic numeral system. Its development involved decimal place value and the use of zero in Indian mathematics, followed by transmission through the Islamic world and into Europe. Earlier Babylonian mathematics used sexagesimal place value, although its notation differed from modern systems with a consistently explicit radix point.
The subdivisions of hours into minutes and seconds, and degrees into minutes and seconds, preserve sexagesimal conventions. Complete modern date and time expressions, however, combine several different unit ratios rather than forming a single uniform base-sixty numeral.
Arithmetic and the choice of base
The usual procedures of arithmetic depend on the radix through their carrying and borrowing rules. If a digit-column total is , it is replaced by the remainder on division by , while the quotient is carried to the next position.
For example, in base eight,
Borrowing one unit from the next higher position supplies units in the current position.
Radix also affects which divisibility tests are convenient. Since
an integer and the sum of its base- digits have the same remainder modulo . Similarly, because , an alternating sum of digits gives the remainder modulo . These are applications of modular arithmetic and explain familiar decimal divisibility tests for nine and eleven.
Conversion between bases
Base conversion preserves a number’s value while changing its digit sequence.
Evaluating a numeral
A numeral can be evaluated by summing its digits times the appropriate powers of its radix:
For a long integer numeral, repeated multiplication and addition gives an efficient algorithm. For example,
This is an instance of evaluating a polynomial by nested multiplication.
Producing digits in a new base
To express a nonnegative integer in base , repeatedly divide by , recording the remainders. The remainders, read in reverse order, are the digits.
For example,
so .
For a fractional part , with , repeatedly multiply by . At each step, the integer part becomes the next digit, and the remaining fractional part is used for the following step. This procedure may terminate or continue indefinitely.
Conversion between related bases
When one radix is a power of another, conversion can be performed by grouping digits. Since , one octal digit corresponds to three binary digits; since , one hexadecimal digit corresponds to four.
Thus,
Groups are formed outward from the radix point, adding zeros at the outer ends if necessary.
Fractional expansions
A base- expansion of a real number can continue indefinitely to the right of the radix point:
The fractional part converges because its digit values are bounded and its place values decrease geometrically.
Terminating expansions
A rational number , written in lowest terms with , has a terminating base- expansion exactly when
for some nonnegative integer . Equivalently, every prime factor of must also divide .
Consequently:
- In base ten, a reduced denominator may contain only factors of two and five for the expansion to terminate.
- In base two, the reduced denominator must be a power of two.
- In base twelve, reduced denominators containing only factors of two and three yield terminating expansions.
For example,
but , despite terminating in decimal notation, repeats in binary.
Repetition and irrationality
In any integer base , a real number is rational if and only if its digit expansion is eventually periodic, counting a terminating expansion as one followed by zeros.
In the division process for a rational number, only finitely many remainders are possible. A remainder therefore either becomes zero or repeats, producing a repeating sequence of digits. Conversely, a repeating digit block can be evaluated using a geometric series, giving a rational value.
An irrational number has an expansion that neither terminates nor becomes periodic in any integer base.
Nonunique expansions
A number with a terminating expansion also has an alternative expansion ending in an infinite sequence of digits of value . For example,
In general,
This equality follows from the limit of the partial sums; the repeating expansion is not merely an approximation. Excluding expansions that eventually consist entirely of gives a standard unique representation, apart from leading zeros.
Radix in computing
Binary arithmetic is widely used in computing because digital circuits can represent two logical states reliably. Octal and hexadecimal provide shorter written forms of binary data without changing its underlying value.
The radix of floating-point arithmetic determines the place values of the significand. A floating-point number is commonly modeled as
where determines the sign, is a significand of limited precision, is the radix, and is an exponent.
An important consequence is that a finite decimal fraction need not be exactly representable in a binary floating-point format. For example, has an infinite repeating binary expansion and must be rounded when stored at finite binary precision. Conversely, any finite binary fraction has a terminating decimal expansion, although it may require many decimal digits.
The radix also affects representation length. For a positive integer , the number of base- digits is
where is a logarithm to base . Larger radices use fewer digit positions but require more distinguishable digit values. In information theory, a uniformly selected digit from possibilities carries bits of information.
Generalizations and related terminology
Several numeral systems modify the standard assumptions:
- Negative bases: A radix such as , with digits and , permits finite representations of both positive and negative integers without a separate sign.
- Balanced digit systems: Balanced ternary uses radix three with digit values . Negative values are represented through signed digits rather than necessarily through a leading minus sign.
- Noninteger bases: A real radix gives place values . Digit selection and uniqueness depend on the rules adopted for the expansion.
- Mixed-radix systems: The ratio between successive place values varies. Time expressions and numeral systems based on factorials are examples.
- Bijective numeration: These systems typically use digit values , without a zero digit. Spreadsheet column labels provide a familiar base-26-style example.
- Unary notation: Sometimes called base one, unary represents quantities by repetition of a symbol. It is not an ordinary positional system with successive powers of a radix.
The base of a numeral system is distinct from the cardinality of a set, even though “cardinal” and corresponding terms in some languages can resemble terminology for numeral bases. Radix describes a representation convention; cardinality describes the size of a set.