Floating point systems

GUIDING QUESTION: How is a real number represented in a computer?
What does it mean for us?


Number systems

We represent numbers using strings of symbols called digits. Currently, we use a positional base $10$ number system:

  • the position of each digit determines its value, and
  • we use the ten digits $0, 1, 2, \ldots, 9$.
We write the number three hundred and thirty-three with three identical symbols but each digit represents a different value.

Real numbers

Currently, we use a positional base $10$ number system.

Strings of digits obtain meaning via the expanded form.

The symbol $1457$ is defined by \begin{align*} 1457 ≔ 1*10^3 + 4*10^2 + 5*10^1 + 7*10^0. \end{align*}

Arbitrary bases

Positional number systems with different bases give meaning to strings of digits in a similar fashion.

We can express the decimal number $23_{10}$ in the bases $5$, $3$, and $2$, respectively: \begin{alignat}{2} 23_{10} &= 2*10^1 + 3*10^0 && \\ &=4*5^1 + 3*5^0 && = 43_5 \\ &=2*3^2 + 1*3^1 + 2*3^0 &&= 212_3 \\ &=1*2^4 + 0*2^3 + 1*2^2 + 1*2^1 + 1*2^0 && = 10111_2 .\\ \end{alignat} The subscript $23_\beta$ denotes the base used.

The base $2, 3, 5$, and $10$ positional number system is called binary, ternary, quinary, and decimal, respectively.

Historical remarks

Dating back more than four millennia, the Babylonian number system is one of the oldest known in writing. In fact, it is the oldest known positional system. A historical exception in many respects, it was sexagesimal (base 60).