Why is floating point called floating point?

476 views

I tried to Google that but it didn’t help, so please be patient with me. I found this:

“The term floating point is derived from the fact that there is no fixed number of digits before and after the decimal point; that is, the decimal point can float. There are also representations in which the number of digits before and after the decimal point is set, called fixed-point representations. In general, floating-point representations are slower and less accurate than fixed-point representations, but they can handle a larger range of numbers.”

That doesn’t make sense to me. The decimal point stays where it is. What am I missing here?

In: 9

6 Answers

Anonymous 0 Comments

Suppose you wanted to represent the numbers 20 and 0.2 using only 4 digits. You could do it this way, keeping the decimal point in the middle:

20.00

00.20

But if you wanted to represent 20,000 or 0.00000002, you’d be in trouble. Floating point solves that by using one digit to represent how far you have to shift the decimal point to get the actual number. So

20 is 2.00 (+1)

0.2 is 2.00 (-1)

20,000 is 2.00 (+4)

etc. The system above would let you represent any number from .0000000001 to 9,990,000,000 with good accuracy using just four digits. This is all built on the mathematics of exponents, and in a real computer it covers a much wider range and happens in binary rather than decimal, but this is an ELI5 explanation.

You are viewing 1 out of 6 answers, click here to view all answers.