
The precision and range of floating point numbers is determined by the number of bits used to store them, which is defined within the underlying standard C library, upon which the programming language being used dependents. Floating point numbers are usually double precision, so the number is stored using twice the number of bits that the underlying platform uses for its registers. This means that on a 32 bit platform, 64 bits are used to store a floating point number.
The range of values that can be represented as floating point numbers is far greater that the range of numbers that can be stored as integers. On a typical 32 bit platform, using double precision floating point, using a mantissa of 52 bits and an exponent of 11 bits, and 1 bit for the sign, floating point numbers have an approximate of range of 10e-308 to 10e308.
Not all numbers can be represented accurately using floating point representation, so this may affect the accuracy of floating point calculations.
Problems with accuracy arise from using floating point numbers, because although the numbers are being displayed in decimal (base 10), they are internally stored and manipulated in binary (base 2), and fractional numbers in one base cannot always be accurately expressed in another base.
|
|
Wikipedia Article |