Decimal

Let’s learn about the decimal number system.

Everyone is familiar with decimal numbers. We use decimal numbers in our calculations everyday. Representing numbers in decimals is just one possible way of writing a number. There are many other writing methods, such as Roman numbers and Chinese characters. This section introduces two other ways of writing numbers: binary and hex. Binary and hex are particularly useful in digital communication. In fact, at the most fundamental level, binary numbers are the basis of all computing. In this section, we’ll make extensive use of the notation for decimal exponentiation. For example, if we write 10710^7 (10 to the power 7), then we mean 10 multiplied by itself seven times:

107=10×10×10×10×10×10×1010^7 = 10 \times 10 \times 10 \times 10 \times 10 \times 10 \times 10

Note: It is a standard mathematical convention to say that any number raised to the power 0 is 1. For example, 10010^0 = 1.

Decimal

Let’s understand some of the principles behind decimal numbers.

Writing a number as a decimal

Consider the number 359. What do 3, 5, and 9 actually represent? Observe that:

359=300+50+9359 = 300 + 50 + 9

=(3×100)+(5×10)+(9×1)= (3 \times 100) + (5 \times 10) + (9 \times 1)

=(3×102)+(5×101)+(9×100)= (3 \times 10^2 ) + (5 \times 10^1 ) + (9 \times 10^0)

All we have done in these last three lines is rewrite the number 359 in a form that shows how it can be represented as a sum of multiples of powers of ten. This is why our most familiar numbers are often referred to as decimal numbers: the digits we use to write them to indicate the multiples of powers of ten that are added together to make up the number. Observe two things:

  1. The digits of a decimal number can take any of the values from 0 up to 9.

  2. Every digit in a decimal number will be multiplied by some power of 10. The powers of 10 start with 0 (the furthest digit to the right) and then increase from right to left.

Decimal numbers are sometimes also referred to as base 10 numbers. This is because the representation of the number in digits is ‘based’ on the powers of 10, as we have just seen. We normally don’t bother indicating that a number is written in base 10, since this tends to be assumed by default. However, because we will be changing numbers from one base into another, we will often need to indicate the base being used. To indicate that the number 359 is a decimal number, we will sometimes write it as 35910359_{10}.

Leading zeros

As a last remark about decimal (or any number base), any number of zeros can be put in front of a decimal number without changing its value. These are called leading zeros. For example:

00013=013=1300013 = 013 = 13

This is consistent with our previous way of expressing decimal numbers, since:

00013=(0×104)00013 = (0 \times 10^4 )

=(0×103)+(0×102)+(1×101)+(3×100)= (0 \times 10^3 ) + (0 \times 10^2 ) + (1 \times 10^1 ) + (3 \times 10^0)

=0+0+0+(1×101)+(3×100)=(1×101)+(3×100)=13= 0 + 0 + 0 + (1 \times 10^1 ) + (3 \times 10^0) = (1 \times 10^1 ) + (3 \times 10^0) = 13

Of course, when writing numbers in decimal, we do not normally use any leading zeros.

Get hands-on with 1200+ tech skills courses.