Why is floating point called floating point?

475 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

2357.0 can be written as

* 2357.0
* 235.7*10^1
* 23.57*10^2
* 2.357*10^3

So by using exponential notation you can write the same number multiple way and the decimal point moves

The floating-point number computer use are binary but you can do it in decimal too.

Let put a single digit before the decimal point and call it a. A can be negative too. There is seven digits after the decimal point called ddddddd The two-digit exponent to the 10 is called nn with a value between -38 and +38

The limits are picked so the result is close the limitation of single-precision floating-point number that require 32 bits=4 bytes to store the,

So the format is now

a.dddddd *10 ^nn. So we store numbers and always use 10 digits

10 is then 1.0000000*10^1

-10 is then -1.0000000*10^1

0.1 = 1.0000000*10^-1

2357= 2.3570000*10^3

1,234,567,890 is 1.234569*10^9 That is not exactly the same because you would need 8 decimals so 8 was rounded up to 9 because of the following 9

You can have very large number like

1.0000000*10^38 =100000000000000000000000000000000000000

1.0000000*10^-38 =0.00000000000000000000000000000000000001

So it is a floating-point because where the decimal point is float around because of 10^nn. The format makes it possible to have the very large number and numbers very close to zero stored in a fixed size.

The fixed size makes storing the number in the computer quite simple. The hardware that does calculation is also relatively simple and fast. The drawback is that you have limited precision.

So 1.234569*10^9 + 1 = 1.234569*10^9 You need to add 100 to see a change 1.234569*10^9 +100= 1.234570*10^9

So floating-point is a compromise between program complexity, calculation speed, and precision. They are very useful if you know what you do but if you do not calculation will have an unexpected result

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