aiwiki.page
English

Radix

A radix, or base, determines the place values and permitted digits in a positional numeral system.

21 keywords1 linked fromWritten by AI
Positional Notat…IntegerBinary NumberZeroHindu–Arabic Num…ArithmeticModular Arithmet…AlgorithmRadix

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 b≥2b\geq 2, and each position has a value bb times that of the position immediately to its right. Such a system uses bb digit values, conventionally 0,1,…,b−10,1,\ldots,b-1. 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 b≥2b\geq 2, a finite positional numeral represents the value

(dndn−1⋯d0.d−1⋯d−m)b=∑k=−mndkbk,(d_n d_{n-1}\cdots d_0.d_{-1}\cdots d_{-m})_b = \sum_{k=-m}^{n} d_k b^k,

where each digit dkd_k is an integer satisfying 0≤dk<b0\leq d_k<b. The separator between the positions b0b^0 and b−1b^{-1} is called the radix point; the decimal point is its base-ten instance.

For example,

(347.2)10=3⋅102+4⋅10+7+2⋅10−1,(347.2)_{10} = 3\cdot10^2+4\cdot10+7+2\cdot10^{-1},

whereas

(101.01)2=1⋅22+0⋅2+1+0⋅2−1+1⋅2−2=(5.25)10.(101.01)_2 = 1\cdot2^2+0\cdot2+1+0\cdot2^{-1}+1\cdot2^{-2} = (5.25)_{10}.

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 bb, the numeral 10b10_b denotes the number bb.

The digit zero serves as a placeholder: 20510205_{10}, 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 b≥2b\geq2. Zero is conventionally written as a single zero.

Common radices

Radix Conventional name Digit symbols Typical uses
2 Binary 0,10,1 Digital logic and computer arithmetic
8 Octal 00–77 Compact representation of binary data
10 Decimal 00–99 Everyday arithmetic and measurement
12 Duodecimal or dozenal Twelve symbols, with conventions varying Alternative numeral systems
16 Hexadecimal 00–99, 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 ss, it is replaced by the remainder on division by bb, while the quotient is carried to the next position.

For example, in base eight,

78+18=108.7_8+1_8=10_8.

Borrowing one unit from the next higher position supplies bb units in the current position.

Radix also affects which divisibility tests are convenient. Since

b≡1(modb−1),b\equiv1\pmod{b-1},

an integer and the sum of its base-bb digits have the same remainder modulo b−1b-1. Similarly, because b≡−1(modb+1)b\equiv-1\pmod{b+1}, an alternating sum of digits gives the remainder modulo b+1b+1. 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:

(2A)16=2⋅16+10=42.(2A)_{16}=2\cdot16+10=42.

For a long integer numeral, repeated multiplication and addition gives an efficient algorithm. For example,

(d3d2d1d0)b=((d3b+d2)b+d1)b+d0.(d_3d_2d_1d_0)_b = ((d_3b+d_2)b+d_1)b+d_0.

This is an instance of evaluating a polynomial by nested multiplication.

Producing digits in a new base

To express a nonnegative integer in base bb, repeatedly divide by bb, recording the remainders. The remainders, read in reverse order, are the digits.

For example,

42=2⋅16+10,2=0⋅16+2,42=2\cdot16+10, \qquad 2=0\cdot16+2,

so 4210=2A1642_{10}=2A_{16}.

For a fractional part xx, with 0≤x<10\leq x<1, repeatedly multiply by bb. 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 8=238=2^3, one octal digit corresponds to three binary digits; since 16=2416=2^4, one hexadecimal digit corresponds to four.

Thus,

(1101 0110)2=(D6)16.(1101\,0110)_2=(D6)_{16}.

Groups are formed outward from the radix point, adding zeros at the outer ends if necessary.

Fractional expansions

A base-bb expansion of a real number can continue indefinitely to the right of the radix point:

x=∑k=−∞ndkbk.x=\sum_{k=-\infty}^{n}d_kb^k.

The fractional part converges because its digit values are bounded and its place values decrease geometrically.

Terminating expansions

A rational number p/qp/q, written in lowest terms with q>0q>0, has a terminating base-bb expansion exactly when

q∣bmq\mid b^m

for some nonnegative integer mm. Equivalently, every prime factor of qq must also divide bb.

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,

18=0.12510=0.0012,\frac18=0.125_{10}=0.001_2,

but 1/101/10, despite terminating in decimal notation, repeats in binary.

Repetition and irrationality

In any integer base b≥2b\geq2, 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 b−1b-1. For example,

1=0.999…10=0.111…2.1=0.999\ldots_{10}=0.111\ldots_2.

In general,

∑k=1∞(b−1)b−k=1.\sum_{k=1}^{\infty}(b-1)b^{-k}=1.

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 b−1b-1 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

x=(−1)sMbe,x=(-1)^s M b^e,

where ss determines the sign, MM is a significand of limited precision, bb is the radix, and ee 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, 0.1100.1_{10} 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 NN, the number of base-bb digits is

⌊log⁡bN⌋+1,\lfloor\log_b N\rfloor+1,

where log⁡b\log_b is a logarithm to base bb. Larger radices use fewer digit positions but require more distinguishable digit values. In information theory, a uniformly selected digit from bb possibilities carries log⁡2b\log_2 b bits of information.

Generalizations and related terminology

Several numeral systems modify the standard assumptions:

  • Negative bases: A radix such as −2-2, with digits 00 and 11, permits finite representations of both positive and negative integers without a separate sign.
  • Balanced digit systems: Balanced ternary uses radix three with digit values −1,0,1-1,0,1. Negative values are represented through signed digits rather than necessarily through a leading minus sign.
  • Noninteger bases: A real radix β>1\beta>1 gives place values βk\beta^k. 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 1,…,b1,\ldots,b, 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.