Floating point type represents a number by storing its significant digits and its exponent separately on separate binary words so it fits in 16, 32, 64 or 128 bits. Fixed point type stores numbers. So even if you have a.
A comment for everybody trying to do floating point arithmetic in your script, ask yourself: Sometimes you can really get along without. For example, the decimal number 9.2 can be expressed exactly as a ratio of two decimal integers (92/10), both.
Why do some numbers lose accuracy when stored as floating point numbers? And also, any significant floating point program is likely to have significant integer work too even if it's only calculating indices into arrays, loop counter etc. Floating point numbers are more general purpose because they can represent very small or very large numbers in the same way, but there is a small penalty in having to. Do i really need floating point arithmetic?
Binary floating point math works like this. The crux of the problem is that numbers are represented in this format as a. B is a fixed base (a base determined by the format, not varying with the represented values), s is a sign. In most programming languages, it is based on the ieee 754 standard.