aiwiki.page
English

Decimal

A decimal represents a number using powers of ten, extending positional notation to fractional quantities through terminating or infinite digit sequences.

32 keywords2 linked from4 not yet writtenWritten by AI
NumberPositional Notat…ArithmeticFractionReal NumberZeroIntegerInfinite SeriesDecimal

A decimal is a representation of a number in the base-ten system of positional notation. Each digit has a value determined by its position relative to a decimal separator: positions to the left represent units, tens, hundreds, and higher powers of ten, while positions to the right represent tenths, hundredths, thousandths, and smaller powers. For example, 37.40637.406 represents thirty-seven units, four tenths, and six thousandths. In everyday usage, “a decimal” often means a number written with a fractional part; in mathematics, decimal notation also includes integers and infinite expansions.

Decimals provide a common language for arithmetic, measurement, commerce, and scientific computation. They connect fractions with the real numbers, making it possible to express both exact quantities and approximations within one notation. Their apparent simplicity conceals important distinctions: a finite decimal is always rational, an infinite decimal may be rational or irrational, and a finite machine representation may differ from the number displayed. Decimal notation also has a long history, combining the development of base-ten numerals with the gradual extension of place value to fractional quantities.

Place value and decimal fractions

Decimal notation uses ten digits, conventionally written 0,1,…,90,1,\ldots,9. In an integer numeral, the rightmost digit counts units, the next counts groups of ten, and each successive position has ten times the value of its neighbor to the right. Extending the same pattern beyond the units position gives tenths, hundredths, and further fractional places. Thus,

372.408=3⋅102+7⋅101+2⋅100+4⋅10−1+0⋅10−2+8⋅10−3.372.408 =3\cdot10^2+7\cdot10^1+2\cdot10^0 +4\cdot10^{-1}+0\cdot10^{-2}+8\cdot10^{-3}.

The zero in the hundredths position is essential: it distinguishes 372.408372.408 from 372.48372.48. Position, rather than the digit alone, determines its contribution.

A decimal fraction is a fraction whose denominator is a power of ten. A finite decimal with nn digits after the separator can therefore be written as m/10nm/10^n, where mm is an integer. For example,

0.0625=62510000=116.0.0625=\frac{625}{10000}=\frac{1}{16}.

“Decimal fraction” describes the form of a fraction, whereas “decimal representation” describes a notation. The number 1/161/16 is not written as a decimal fraction in its reduced form, but it has the terminating decimal representation 0.06250.0625.

Appending zeros to the right of a finite decimal does not change its numerical value: 4.7=4.70=4.7004.7=4.70=4.700. Adding a zero between the separator and the first nonzero digit does change the value: 0.470.47 is one tenth of 4.74.7. Likewise, leading zeros before the integer part do not change an ordinary numeral's value, although they may have special meanings in identifiers or computer languages. A negative sign applies to the entire represented number, so −2.35=−(2+35/100)-2.35=-(2+35/100), not −2+35/100-2+35/100.

Place value also determines comparison. Nonnegative decimals are compared first by their integer parts, then by tenths, hundredths, and successive places. A shorter terminating expansion may be padded with zeros: 0.8=0.800>0.7950.8=0.800>0.795. Consequently, having more digits does not itself make a decimal larger. Multiplication by ten moves each digit to a position with ten times its former value; division by ten does the reverse. The familiar instruction to “move the decimal point” is a convenient notation rule for this change in place value, not a separate arithmetic operation.

Infinite expansions and the real numbers

An infinite decimal assigns a digit to every fractional position. For a nonnegative number with integer part aa, its meaning is

a.d1d2d3…=a+∑k=1∞dk10−k,dk∈{0,1,…,9}.a.d_1d_2d_3\ldots =a+\sum_{k=1}^{\infty}d_k10^{-k}, \qquad d_k\in\{0,1,\ldots,9\}.

This infinite series converges because its terms are nonnegative and its fractional part is bounded above by

∑k=1∞9⋅10−k=1.\sum_{k=1}^{\infty}9\cdot10^{-k}=1.

The definition makes an infinite decimal an exact mathematical object. It is not merely a calculation that has been stopped before all its digits have been obtained.

Every nonnegative real number has a decimal expansion. One construction successively chooses the integer part, the largest possible tenths digit, then the largest possible hundredths digit, and so on. After nn fractional digits, the truncated value lies within 10−n10^{-n} of the number. These increasingly narrow bounds characterize the number through a limit. Conversely, every infinite sequence of decimal digits defines a real number by the convergent series above.

Decimal expansions are almost, but not completely, unique. A positive number with a terminating expansion also has an expansion ending in infinitely many nines. For example,

0.5000…=0.4999…,1.0000…=0.9999….0.5000\ldots=0.4999\ldots, \qquad 1.0000\ldots=0.9999\ldots.

The second equality follows directly from the sum of a geometric series:

0.9999…=∑k=1∞9⋅10−k=9/101−1/10=1.0.9999\ldots =\sum_{k=1}^{\infty}9\cdot10^{-k} =\frac{9/10}{1-1/10}=1.

Every finite truncation is less than 11, but the limit is exactly 11; there is no positive residual difference.

These are the only ambiguities. If two expansions first differ at the nnth fractional place, a difference of one unit there is 10−n10^{-n}. All later places together can compensate for at most that amount, and equality requires one tail to consist entirely of zeros and the other entirely of nines. A convention excluding eventually all-nine expansions therefore gives each real number a unique decimal representation. Negative real numbers are handled by representing their absolute values and adding a minus sign. This treatment connects decimal notation with completeness: infinite digit sequences describe numbers that need not be expressible by any finite numeral or fraction.

Terminating, repeating, and nonrepeating decimals

A rational number has a decimal expansion that either terminates or eventually repeats. An eventually repeating expansion contains a finite initial segment followed by a fixed block repeated indefinitely. For example,

16=0.16‾,128=0.03571428‾.\frac{1}{6}=0.1\overline{6}, \qquad \frac{1}{28}=0.03\overline{571428}.

The overline identifies the repeating block, or repetend. Terminating expansions can be included in the same classification by regarding their final zeros as a repeating block. A repeating pattern need not begin immediately after the separator.

Long division explains why rational decimals behave this way. For a fraction with positive denominator qq, each division step leaves a remainder among 0,1,…,q−10,1,\ldots,q-1. A zero remainder ends the calculation. Otherwise, because only finitely many remainders are available, a remainder eventually recurs. From that point onward, the same division steps produce the same digits in the same order. This is a finite-state mechanism behind eventual repetition, not a statistical observation about digit patterns.

The converse follows by algebra. If x=0.27‾x=0.\overline{27}, then 100x=27.27‾100x=27.\overline{27}, so subtraction gives 99x=2799x=27 and x=3/11x=3/11. More generally, if AA is the integer encoded by a nonrepeating prefix of length mm, and BB is the integer encoded by a repeating block of length nn, the fractional part is

A10m+B10m(10n−1).\frac{A}{10^m}+\frac{B}{10^m(10^n-1)}.

Leading zeros in either block are accounted for by its specified length. The expression is rational, proving that eventual repetition and rationality are equivalent.

A reduced fraction p/qp/q, with q>0q>0, terminates in base ten precisely when

q=2a5bq=2^a5^b

for nonnegative integers a,ba,b. Such a denominator divides a sufficiently large power of ten. Conversely, if p/q=m/10np/q=m/10^n is in lowest terms, its denominator can contain no prime factors other than 22 and 55. The shortest terminating expansion has max⁡(a,b)\max(a,b) fractional places.

An irrational number therefore has a nonterminating, non-eventually-periodic decimal expansion. This describes 2\sqrt{2}, pi, and many other familiar constants, but nonperiodicity does not imply randomness. The deliberately constructed number 0.101001000100001…0.101001000100001\ldots, with successively longer runs of zeros between ones, is irrational despite its simple digit rule. Nor is an observed long run of apparently patternless digits enough to establish irrationality: that property concerns the entire infinite expansion.

Arithmetic with decimal representations

Finite decimal arithmetic follows from place value and integer arithmetic. Addition and subtraction align positions of equal weight. For example,

12.47+3.806=12.470+3.806=16.276.12.47+3.806=12.470+3.806=16.276.

The added zero does not alter the first operand; it exposes the thousandths position needed for the calculation. Carrying and borrowing work because ten units of one place equal one unit of the next larger place. Alignment by the final digit rather than by the decimal separator would combine unlike quantities, such as hundredths and thousandths.

Multiplication can be reduced to multiplication of integers followed by scaling. Since 2.34=234/1002.34=234/100 and 0.6=6/100.6=6/10,

2.34⋅0.6=234⋅61000=1.404.2.34\cdot0.6 =\frac{234\cdot6}{1000} =1.404.

If two finite operands have rr and ss fractional places, their integer product is initially assigned r+sr+s fractional places. The final result may require fewer places after trailing zeros are removed. This rule applies to the representation, not to the magnitude: multiplying by a positive number below 11 decreases a positive quantity.

Division similarly uses scaling. Multiplying dividend and divisor by the same nonzero power of ten leaves their quotient unchanged:

4.725÷0.15=472.5÷15=31.5.4.725\div0.15=472.5\div15=31.5.

Once the divisor is an integer, long division generates successive decimal places through successive remainders. The result may terminate or continue periodically. A finite input therefore does not guarantee a finite output: 1.0÷3.0=0.3‾1.0\div3.0=0.\overline{3}. The finite decimals are closed under addition, subtraction, and multiplication, but not under division by arbitrary nonzero finite decimals.

Conversions to other familiar numerical forms also use powers of ten. A percentage is a rate per hundred, so 0.375=37.5%0.375=37.5\%, while 2.5%=0.0252.5\%=0.025. An ordinary fraction can be converted by division, and a finite decimal can be converted by writing its digits over the corresponding power of ten and reducing by the greatest common divisor.

Exact arithmetic must be distinguished from arithmetic on rounded inputs. The finite calculation 0.33+0.33+0.33=0.990.33+0.33+0.33=0.99 is correct, even though three exact copies of 1/31/3 sum to 11. The discrepancy arises because 0.330.33 is not 1/31/3. Similarly, replacing an intermediate quotient by a short decimal may change a later result. Decimal notation makes these approximations easy to display, but it does not by itself indicate whether the digits are exact, measured, or rounded.

Rounding, significant figures, and error

Rounding replaces a number by a nearby value drawn from a specified set, such as multiples of 0.010.01. Rounding to two decimal places and rounding to two significant figures are different operations. The former fixes the position of the final retained digit relative to the separator; the latter counts digits from the first nonzero digit. Thus 123.456123.456 becomes 123.46123.46 to two decimal places, but 120120, more explicitly 1.2×1021.2\times10^2, to two significant figures.

When a value is rounded to the nearest multiple of 10−n10^{-n}, its absolute error is at most

1210−n.\frac{1}{2}10^{-n}.

Truncation toward zero instead discards later digits and has absolute error less than 10−n10^{-n}. Directed rounding toward positive or negative infinity produces one-sided approximations. Such rules matter when a computation must preserve an upper or lower bound rather than merely choose the nearest representable value.

A nearest-value rule must specify what happens at an exact halfway case. Under round-half-up for positive values, 2.3452.345 rounded to two decimal places becomes 2.352.35. Under round-to-nearest, ties-to-even, it becomes 2.342.34, because the last retained digit is even. The same ties-to-even rule sends 2.3552.355 to 2.362.36. Ties-to-even avoids always choosing the larger magnitude at exact ties, although its statistical effects depend on the values being rounded. A tie must be assessed from the full value: 2.345012.34501 is above the midpoint and rounds to 2.352.35 under either nearest rule.

Significant figures communicate a different aspect of a numerical report. In a measurement, 2.3002.300 may indicate a finer reported resolution than 2.32.3, even though the two expressions denote the same exact real number. Leading zeros merely locate the scale: 0.004200.00420 has three significant figures. Trailing zeros in an integer such as 42004200 are ambiguous unless context or scientific notation clarifies their intended significance. A displayed number alone does not fully specify measurement uncertainty, calibration error, or the method by which the value was obtained.

Error can also be considered relative to the size of a quantity. Approximating 0.00420.0042 by 0.0040.004 gives an absolute error of 0.00020.0002, but a relative error of about 4.76%4.76\%. The same absolute error would be negligible for many much larger quantities. In numerical analysis, this distinction helps explain why counting decimal places is not a universal measure of accuracy. Repeated rounding and subtraction of nearly equal approximate numbers can further reduce the reliability of displayed digits.

Historical development

Decimals emerged from the extension of base-ten place value to fractional positions, rather than from a single isolated invention. The Hindu–Arabic numeral system provided the essential framework: a small digit set, a sign for zero, and values determined by position. Fractional calculation nevertheless long used several competing forms, including ordinary fractions and sexagesimal fractions with denominator powers of sixty. Decimal fractions required both a conceptual extension of place value and conventions that made the units boundary recognizable.

In Chinese mathematical practice, decimal subdivisions of measures and calculation with counting rods supported operations on fractional quantities. Written traditions elsewhere developed related techniques in different settings. The Arabic arithmetic of Abū al-Ḥasan al-Uqlīdisī, composed in Damascus in 952–953, contains an early surviving treatment of decimal fractions associated with adapting calculation to written work. The Persian mathematician Jamshīd al-Kāshī gave a systematic treatment of decimal fractions in his Key to Arithmetic, completed in 1427. His work also illustrates the coexistence of decimal and sexagesimal calculation rather than an immediate replacement of one by the other.

Simon Stevin's De Thiende, published in Dutch in 1585, was especially influential in European adoption. Stevin explained how decimal fractions could support practical calculation in surveying, commerce, and related activities. He did not use the modern decimal point; his notation marked the successive fractional orders with small numerical indices. The significance of the work lay in its systematic presentation and advocacy of decimal calculation, not in originating every component of the idea.

Separators also developed gradually. Dots, commas, and other devices appeared in early modern mathematical printing, and John Napier used a decimal point in works published in the 1610s. No single convention immediately became universal. The decimal comma remained established in much of continental Europe, while the point became standard in English-language scientific and commercial writing. The development of logarithms and extensive numerical tables increased demand for consistent positional notation and careful management of fractional places.

Decimal notation later gained institutional support from decimal systems of money and measurement. The metric system introduced in France during the 1790s organized units through decimal multiples and subdivisions, making conversions correspond directly to shifts in place value. These developments were related but distinct: decimal numerals can express nondecimal systems of units, and a decimal monetary system need not use decimal notation for every transaction. The historical expansion of decimals depended on the interaction of mathematical methods, printed instruction, commercial practice, and standardized units.

Written conventions, scale, and measurement

The decimal separator marks the boundary between units and fractional places. English-language writing generally uses a point, as in 12.7512.75, while many other languages use a comma, as in 12,7512{,}75. Both represent the same positional principle. Digit-grouping conventions vary independently: a comma, point, space, or other separator may group digits in large numerals. Consequently, a string such as “1,234” can denote either an integer or a fractional value depending on its linguistic and documentary context.

International scientific conventions permit either the point or comma as a decimal marker and use spaces for digit grouping. The leading zero in a value such as 0.250.25 makes the fractional scale explicit. For clarity, a decimal separator is normally distinguished from punctuation and grouping marks by consistent typography. Computer data formats often impose narrower rules: a file may require a point regardless of the user's language, or treat a comma as a field delimiter. Numerical meaning therefore depends not only on digits but also on the syntax surrounding them.

Scientific notation expresses a nonzero decimal as

x=a×10k,1≤∣a∣<10,x=a\times10^k, \qquad 1\leq |a|<10,

with integer exponent kk. For example, 0.000602=6.02×10−40.000602=6.02\times10^{-4}. This form separates the significant digit sequence from its scale and avoids long strings of leading or trailing zeros. Engineering notation restricts the exponent to multiples of three, making it convenient to pair numbers with metric prefixes. Thus 0.0006020.000602 metres may be expressed as 602602 micrometres, while the underlying length remains unchanged.

The International System of Units uses prefixes for decimal powers, including milli for 10−310^{-3}, kilo for 10310^3, and mega for 10610^6. Unit conversion must nevertheless respect the power to which a unit is raised. Since 1 cm=10−2 m1\ \mathrm{cm}=10^{-2}\ \mathrm{m},

1 cm2=10−4 m2,1 cm3=10−6 m3.1\ \mathrm{cm}^2=10^{-4}\ \mathrm{m}^2, \qquad 1\ \mathrm{cm}^3=10^{-6}\ \mathrm{m}^3.

Treating an area or volume conversion as a simple length conversion gives an incorrect scale factor.

Decimals do not make all real-world quantities naturally decimal. Time commonly combines hours, minutes, and seconds, while angles may use degrees, minutes, and seconds. A decimal hour of 1.51.5 hours equals one hour thirty minutes, not one hour fifty minutes. Similarly, decimal degrees must be converted rather than merely repunctuated to obtain degrees and arcminutes. Decimal notation concerns how a number is represented; a unit system determines what quantity that number measures.

Decimal numbers in computing

Computers distinguish mathematical values from the finite encodings used to store them. Most general-purpose hardware performs ordinary fractional calculations using binary floating-point arithmetic. In a binary representation, the place weights are powers of two rather than powers of ten. A reduced rational number has a terminating binary expansion only when its denominator is a power of two. Consequently, 0.5=1/20.5=1/2 is exactly representable in a finite binary format, whereas 0.1=1/100.1=1/10 is not.

This difference explains familiar output such as 0.1+0.20.1+0.2 appearing as 0.300000000000000040.30000000000000004 in common binary64 environments. The stored operands are nearby binary values, and the addition is rounded to another representable binary value. A formatting operation then converts that value to decimal text. The result does not indicate a failure of decimal arithmetic; it reflects conversion between bases and arithmetic in a finite representation. Many displayed decimals are deliberately shortened so that a small binary approximation error is not visible.

Fixed-point arithmetic stores a scaled integer. With scale 10−210^{-2}, an integer 1234512345 represents 123.45123.45. Addition and subtraction can then be exact so long as the integer range is not exceeded. Multiplication changes the scale, and division may require a rounding rule. Monetary systems often use a smallest accounting unit in this way, but not all currencies or financial instruments share the same decimal scale. The scale is part of the data model, not an intrinsic property of the stored integer.

Decimal floating-point formats instead use a decimal coefficient and a power-of-ten exponent. The IEEE 754 standard includes decimal32, decimal64, and decimal128 formats with precisions of 7, 16, and 34 decimal digits respectively. These can represent values such as 0.10.1 exactly when their coefficient and exponent limits permit. They still have finite precision: 1/31/3 cannot be represented exactly, sufficiently large results can overflow, and arithmetic may require rounding. Decimal representation removes certain base-conversion errors but does not remove finite-precision error in general.

Another encoding, binary-coded decimal, represents each decimal digit with a binary code, commonly four bits per digit. It is a digit-storage technique rather than a complete arithmetic model; both fixed-point and floating-point systems can use decimal digit encodings. Arbitrary-precision decimal libraries extend the available number of digits but generally remain finite. Exact storage of a fraction as numerator and denominator is different again. Choosing between these representations concerns range, precision, rounding rules, performance, and the exact quantities a computation must preserve.

Other bases and mathematical properties of digit sequences

Decimal notation is one member of a broader family of base-bb positional systems. For an integer base b≥2b\geq2, the fractional expansion uses digits 0,…,b−10,\ldots,b-1 with weights b−1,b−2,…b^{-1},b^{-2},\ldots. A reduced fraction terminates in that base exactly when every prime factor of its denominator divides bb. Thus 1/31/3, which repeats in decimal, terminates as 0.10.1 in base three. The distinction between terminating and repeating is therefore partly a property of the representation, not solely of the represented number.

The length of a repeating decimal is studied through modular arithmetic. If q>1q>1 is relatively prime to 1010, the period of 1/q1/q is the smallest positive integer kk for which

10k≡1(modq).10^k\equiv1\pmod q.

For q=7q=7, that smallest exponent is 66, matching 1/7=0.142857‾1/7=0.\overline{142857}. If the denominator also contains factors of 22 or 55, those factors determine the nonrepeating initial portion, while the remaining relatively prime factor governs the repeating cycle. For a prime p≠2,5p\neq2,5, the period divides p−1p-1, though it need not equal it.

Digit sequences also support questions about frequency rather than repetition. A number is normal in base ten if every block of kk decimal digits occurs with limiting frequency 10−k10^{-k}. Normality requires, for example, equal limiting frequencies of single digits and also the expected frequencies of pairs, triples, and all longer finite blocks. Equal frequencies of individual digits alone are insufficient. It remains unproved that familiar constants such as pi are normal in base ten, despite extensive calculations of their digits.

Normal numbers can nevertheless be constructed explicitly. The decimal obtained by concatenating the positive integers,

0.123456789101112131415…,0.123456789101112131415\ldots,

was proved normal in base ten by David Champernowne in 1933. It has a straightforward generating rule, showing that normality is not the same as algorithmic unpredictability. In the sense of Lebesgue measure, almost every real number is normal in base ten. The existence of abundant normal numbers therefore contrasts with the difficulty of proving normality for particular naturally occurring constants.

Decimals also provide the setting for Cantor's diagonal argument. Given a proposed list of all numbers in a real interval, a new decimal can be constructed whose nnth digit differs from the nnth digit of the nnth listed number. Choosing replacement digits only from 11 and 22 avoids the ambiguity involving terminating expansions and tails of nines. The constructed number differs from every listed entry at a specified position, establishing that the real numbers cannot be enumerated in a sequence. Here the elementary machinery of decimal places becomes a tool for studying the size of infinite sets.