Floating Point Numbers |
We know \(\pi=3.14159265358979\cdots\), where the decimal digits never terminate. For numerical calculations, we consider only a finite number of digits of a number. A \(t\)-digit floating point number of base \(10\) is of the form \[\pm 0.a_1a_2\ldots a_t\cdot 10^e,\] where \(0.a_1a_2\ldots a_t\) is called the mantissa and \(e\) is called the exponent. Usually the mantissa \(0.a_1a_2\ldots a_t\) is normalized, i.e., \(a_1\neq 0\). For example, the normalized \(15\)-digit floating point number of \(\pi\) is \[fl(\pi)=0.314159265358979\cdot 10^1.\]
Note that floating point numbers are approximation of the exact numbers obtained by either chopping or rounding up the digits. The error in calculations caused by the use of floating point numbers is called roundoff error. For example, a computer may calculate the following \[2-(\sqrt{2})^2=-0.444089209850063\cdot 10^{-15},\] which is just a roundoff error. Note that since floating point numbers are rational numbers, a computer cannot express any irrational number without errors. Also note that almost all computers use binary floating point numbers.
Last edited