# Decimal

The**decimal**numeral system (also called

**base-ten**positional numeral system, and occasionally called

**denary**or

**decanary**) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers of the Hindu–Arabic numeral system. The way of denoting numbers in the decimal system is often referred to as

*decimal notation*.

A

*decimal numeral*, or just

*decimal*, or casually

*decimal number*, refers generally to the notation of a number in the decimal numeral system. Decimals may sometimes be identified for containing a decimal separator (for example the "." in or ). "Decimal" may also refer specifically to the digits after the decimal separator, such as in " is the approximation of to

*two decimals*".

The numbers that may be represented in the decimal system are the decimal fractions, that is the fractions of the form , where is an integer, and is a non-negative integer.

The decimal system has been extended to

*infinite decimals*, for representing any real number, by using an infinite sequence of digits after the decimal separator (see Decimal representation). In this context, the decimal numerals with a finite number of non–zero places after the decimal separator are sometimes called

*terminating decimals*. A repeating decimal is an infinite decimal that after some place repeats indefinitely the same sequence of digits (for example ). An infinite decimal represents a rational number if and only if it is a repeating decimal or has a finite number of nonzero digits.

## Origin

Many numeral systems of ancient civilizations use ten and its powers for representing numbers, possibly because there are ten fingers on two hands and people started counting by using their fingers. Examples are Brahmi numerals, Greek numerals, Hebrew numerals, Roman numerals, and Chinese numerals. Very large numbers were difficult to represent in these old numeral systems, and only the best mathematicians were able to multiply or divide large numbers. These difficulties were completely solved with the introduction of the Hindu–Arabic numeral system for representing integers. This system has been extended to represent some non-integer numbers, called

*decimal fractions*or

*decimal numbers*for forming the

*decimal numeral system*.

## Decimal notation

For writing numbers, the decimal system uses ten decimal digits, a decimal mark, and, for negative numbers, a minus sign "−". The decimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; the decimal separator is the dot "" in many countries (including all English speaking ones), but may be a comma "" in other countries (mainly in continental Europe).For representing a non-negative number, a decimal consists of

For representing a negative number, a minus sign is placed before .

The numeral $a\_ma\_\{m-1\}ldots\; a\_0.b\_1b\_2ldots\; b\_n$ represents the number :$a\_m10^m+a\_\{m-1\}10^\{m-1\}+cdots+a\_\{0\}10^0+frac\{b\_1\}\{10^1\}+frac\{b\_2\}\{10^2\}+cdots+frac\{b\_n\}\{10^n\}$ Therefore, the contribution of each digit to the value of a number depends on its position in the numeral. That is, the decimal system is a positional numeral system

## Decimal fractions

The numbers that are represented by decimal numerals are the**decimal fractions**(sometimes called

**decimal numbers**), that is, the rational numbers that may be expressed as a fraction whose denominator is a power of ten. For example, the numerals $0.8,\; 14.89,\; 0.00024,\; 1.618,\; 3.14159$ represent the fractions , , , and . More generally, a decimal with digits after the separator represents the fraction with denominator , whose numerator is the integer obtained by removing the separator.

Expressed as a fully reduced fraction, the decimal numbers are those whose denominator is a product of a power of 2 and a power of 5. Thus the smallest denominators of decimal numbers are :$1=2^0cdot\; 5^0,\; 2=2^1cdot\; 5^0,\; 4=2^2cdot\; 5^0,\; 5=2^0cdot\; 5^1,\; 8=2^3cdot\; 5^0,\; 10=2^1cdot\; 5^1,\; 16=2^4cdot\; 5^0,\; 25=2^0cdot\; 5^2,\; ldots$

The

*integer part*or

*integral part*of a decimal is the integer written to the left of the decimal separator (see also truncation). For a non-negative decimal, it is the largest integer that is not greater than the decimal. The part from the decimal separator to the right is the

*fractional part*, which equals the difference between the numeral and its integer part.

When the integral part of a numeral is zero, it may occur, typically in computing, that the integer part is not written (for example , instead of ). In normal writing, this is generally avoided because of the risk of confusion between the decimal mark and other punctuation.

## Real number approximation

Decimal numerals do not allow an exact representation for all real numbers, e.g. for the real number . Nevertheless, they allow approximating every real number with any desired accuracy, e.g., the decimal 3.14159 approximates the real , being less than 10 off; and so decimals are widely used in science, engineering and everyday life.

More precisely, for every real number

*x*, and every positive integer

*n*, there are two decimals

*L*and

*u*, with at most

*n*digits after the decimal mark, such that

*L*≤

*x*≤

*u*and (

*u*–

*L*) = 10.

Numbers are very often obtained as the result of a measurement. As measurements are generally afflicted with some measurement error with a known upper bound, the result of a measurement is well represented by a decimal with digits after the decimal mark, as soon as the absolute measurement error is bounded from above by 10. In practice, measurement results are often given with a certain number of digits after the decimal point, which indicate the error bounds. For example, although 0.080 and 0.08 denote the same decimal number, the numeral 0.080 suggests a measurement with an error less than 0.001, while the numeral 0.08 indicates an absolute error bounded by 0.01. In both cases, the true value of the measured quantity could be, for example, 0.0803 or 0.0796 (see also significant figures).

## Infinite decimal expansion

For a real number*x*and an integer

*n*≥ 0, let [

*x*]

_{n}denote the (finite) decimal expansion of the greatest number that is not greater than

*x*, which has exactly

*n*digits after the decimal mark. Let

*d*

_{i}denote the last digit of [

*x*]

_{i}. It is straightforward to see that [

*x*]

_{n}may be obtained by appending

*d*

_{n}to the right of [

*x*]

_{n–1}. This way one has :[

*x*]

_{n}= [

*x*]

_{0}.

*d*

_{1}

*d*

_{2}...

*d*

_{n−1}

*d*

_{n},

and the difference of [

*x*]

_{n–1}and [

*x*]

_{n}amounts to :|[

*x*]

_{n}− [

*x*]

_{n–1}| =

*d*

_{n}⋅ 10 < 10,

which is either 0, if

*d*

_{n}= 0, or gets arbitrarily small, when

*n*tends to infinity. According to the definition of a limit,

*x*is the limit of [

*x*]

_{n}when

*n*tends to infinity. This is written as $;\; x\; =\; lim\_\{n\; ightarrowinfty\}\; [x]\_n\; ;$ or :

*x*= [

*x*]

_{0}.

*d*

_{1}

*d*

_{2}...

*d*

_{n}..., which is called an

**infinite decimal expansion**of

*x*.

Conversely, for any integer [

*x*]

_{0}and any sequence of digits $;(d\_n)\_\{n=1\}^\{infty\}$ the (infinite) expression [

*x*]

_{0}.

*d*

_{1}

*d*

_{2}...

*d*

_{n}... is an

*infinite decimal expansion*of a real number

*x*. This expansion is unique if neither all

*d*

_{n}are equal to 9 nor all

*d*

_{n}are equal to 0 for

*n*large enough (for all

*n*greater than some natural number

*N*).

If all

*d*

_{n}for

*n*>

*N*equal to 9 and [

*x*]

_{n}the limit of the sequence $;([x]\_n)\_\{n=1\}^\{infty\}$ is the decimal fraction obtained by replacing the last digit that is not a 9, i.e.:

*d*

_{N}, by

*d*

_{N}+ 1, and replacing all subsequent 9s by 0s (see 0.999...).

Any such decimal fraction, i.e.,

*d*

_{n}= 0 for

*n*>

*N*, may be converted to its equivalent infinite decimal expansion by replacing

*d*

_{N}by

*d*

_{N}− 1, and replacing all subsequent 0s by 9s (see 0.999...).

In summary, every real number that is not a decimal fraction has a unique infinite decimal expansion. Each decimal fraction has exactly two infinite decimal expansions, one containing only 0s after some place, which is obtained by the above definition of [

*x*]

_{n}, and the other containing only 9s after some place, which is obtained by defining [

*x*]

_{n}as the greatest number that is

*less*than

*x*, having exactly

*n*digits after the decimal mark.

### Rational numbers

Long division allows computing the infinite decimal expansion of a rational number. If the rational number is a decimal fraction, the division stops eventually, producing a decimal numeral, which may be prolongated into an infinite expansion by adding infinitely many zeros. If the rational number is not a decimal fraction, the division may continue indefinitely. However, as all successive remainders are less than the divisor, there are only a finite number of possible remainders, and after some place, the same sequence of digits must be repeated indefinitely in the quotient. That is, one has a*repeating decimal*. For example, : = 0. 012345679 012... (with the group 012345679 indefinitely repeating).

Conversely, every eventually repeating sequence of digits is the infinite decimal expansion of a rational number. This is a consequence of the fact that the recurring part of a decimal representation is, in fact, an infinite geometric series which will sum to a rational number. For example, :$0.0123123123ldots\; =frac\{123\}\{10000\}\; sum\_\{k=0\}^infty\; 0.001^k\; =\; frac\{123\}\{10000\}\; frac\{1\}\{1-0.001\}\; =\; frac\{123\}\{9990\}\; =\; frac\{41\}\{3330\}$

## Decimal computation

Most modern computer hardware and software systems commonly use a binary representation internally (although many early computers, such as the ENIAC or the IBM 650, used decimal representation internally). For external use by computer specialists, this binary representation is sometimes presented in the related octal or hexadecimal systems.For most purposes, however, binary values are converted to or from the equivalent decimal values for presentation to or input from humans; computer programs express literals in decimal by default. (123.1, for example, is written as such in a computer program, even though many computer languages are unable to encode that number precisely.)

Both computer hardware and software also use internal representations which are effectively decimal for storing decimal values and doing arithmetic. Often this arithmetic is done on data which are encoded using some variant of binary-coded decimal, especially in database implementations, but there are other decimal representations in use (including decimal floating point such as in newer revisions of the IEEE 754 Standard for Floating-Point Arithmetic).

Decimal arithmetic is used in computers so that decimal fractional results of adding (or subtracting) values with a fixed length of their fractional part always are computed to this same length of precision. This is especially important for financial calculations, e.g., requiring in their results integer multiples of the smallest currency unit for book keeping purposes. This is not possible in binary, because the negative powers of $10$ have no finite binary fractional representation; and is generally impossible for multiplication (or division). See Arbitrary-precision arithmetic for exact calculations.

## History

Many ancient cultures calculated with numerals based on ten, sometimes argued due to human hands typically having ten digits. Standardized weights used in the Indus Valley Civilization () were based on the ratios: 1/20, 1/10, 1/5, 1/2, 1, 2, 5, 10, 20, 50, 100, 200, and 500, while their standardized ruler – the

*Mohenjo-daro ruler*– was divided into ten equal parts. Egyptian hieroglyphs, in evidence since around 3000 BCE, used a purely decimal system, as did the Cretan hieroglyphs () of the Minoans whose numerals are closely based on the Egyptian model. The decimal system was handed down to the consecutive Bronze Age cultures of Greece, including Linear A (c. 18th century BCE−1450 BCE) and Linear B (c. 1375−1200 BCE) – the number system of classical Greece also used powers of ten, including, Roman numerals, an intermediate base of 5. Notably, the polymath Archimedes (c. 287–212 BCE) invented a decimal positional system in his Sand Reckoner which was based on 10 and later led the German mathematician Carl Friedrich Gauss to lament what heights science would have already reached in his days if Archimedes had fully realized the potential of his ingenious discovery. Hittite hieroglyphs (since 15th century BCE) were also.strictly decimal.

Some non-mathematical ancient texts like the Vedas, dating back to 1900–1700 BCE make use of decimals and mathematical decimal fractions.

The Egyptian hieratic numerals, the Greek alphabet numerals, the Hebrew alphabet numerals, the Roman numerals, the Chinese numerals and early Indian Brahmi numerals are all non-positional decimal systems, and required large numbers of symbols. For instance, Egyptian numerals used different symbols for 10, 20, to 90, 100, 200, to 900, 1000, 2000, 3000, 4000, to 10,000. The world's earliest positional decimal system was the Chinese rod calculus.

### History of decimal fractions

Decimal fractions were first developed and used by the Chinese in the end of 4th century BCE, and then spread to the Middle East and from there to Europe. The written Chinese decimal fractions were non-positional. However, counting rod fractions were positional.

Qin Jiushao in his book Mathematical Treatise in Nine Sections (1247) denoted 0.96644 by

:::::寸 :::::File:Counting rod 0.png File:Counting rod h9 num.png File:Counting rod v6.png File:Counting rod h6.png File:Counting rod v4.png File:Counting rod h4.png, meaning :::::寸 :::::096644

J. Lennart Berggren notes that positional decimal fractions appear for the first time in a book by the Arab mathematician Abu'l-Hasan al-Uqlidisi written in the 10th century. The Jewish mathematician Immanuel Bonfils used decimal fractions around 1350, anticipating Simon Stevin, but did not develop any notation to represent them. The Persian mathematician Jamshīd al-Kāshī claimed to have discovered decimal fractions himself in the 15th century. Al Khwarizmi introduced fraction to Islamic countries in the early 9th century; a Chinese author has alleged that his fraction presentation was an exact copy of traditional Chinese mathematical fraction from Sunzi Suanjing. This form of fraction with numerator on top and denominator at bottom without a horizontal bar was also used by al-Uqlidisi and by al-Kāshī in his work "Arithmetic Key". A forerunner of modern European decimal notation was introduced by Simon Stevin in the 16th century.

### Natural languages

A method of expressing every possible natural number using a set of ten symbols emerged in India. Several Indian languages show a straightforward decimal system. Many Indo-Aryan and Dravidian languages have numbers between 10 and 20 expressed in a regular pattern of addition to 10.The Hungarian language also uses a straightforward decimal system. All numbers between 10 and 20 are formed regularly (e.g. 11 is expressed as "tizenegy" literally "one on ten"), as with those between 20 and 100 (23 as "huszonhárom" = "three on twenty").

A straightforward decimal rank system with a word for each order (10 十, 100 百, 1000 千, 10,000 万), and in which 11 is expressed as

*ten-one*and 23 as

*two-ten-three*, and 89,345 is expressed as 8 (ten thousands) 万 9 (thousand) 千 3 (hundred) 百 4 (tens) 十 5 is found in Chinese, and in Vietnamese with a few irregularities. Japanese, Korean, and Thai have imported the Chinese decimal system. Many other languages with a decimal system have special words for the numbers between 10 and 20, and decades. For example, in English 11 is "eleven" not "ten-one" or "one-teen".

Incan languages such as Quechua and Aymara have an almost straightforward decimal system, in which 11 is expressed as

*ten with one*and 23 as

*two-ten with three*.

Some psychologists suggest irregularities of the English names of numerals may hinder children's counting ability.

### Other bases

Some cultures do, or did, use other bases of numbers.*Ngui*means 15,

*ngui ki*means 15 × 2 = 30, and

*ngui ngui*means 15 × 15 = 225.

*Tokapu*means 24,

*tokapu talu*means 24 × 2 = 48, and

*tokapu tokapu*means 24 × 24 = 576.

*Mer*means 6,

*mer an thef*means 6 × 2 = 12,

*nif*means 36, and

*nif thef*means 36×2 = 72.