Double-precision Floating-point Format - IEEE 754 Double-precision Binary Floating-point Format: Binary64

IEEE 754 Double-precision Binary Floating-point Format: Binary64

Double-precision binary floating-point is a commonly used format on PCs, due to its wider range over single-precision floating point, in spite of its performance and bandwidth cost. As with single-precision floating-point format, it lacks precision on integer numbers when compared with an integer format of the same size. It is commonly known simply as double. The IEEE 754 standard specifies a binary64 as having:

  • Sign bit: 1 bit
  • Exponent width: 11 bits
  • Significand precision: 53 bits (52 explicitly stored)

This gives from 15 - 17 significant decimal digits precision. If a decimal string with at most 15 significant decimal is converted to IEEE 754 double precision and then converted back to the same number of significant decimal, then the final string should match the original; and if an IEEE 754 double precision is converted to a decimal string with at least 17 significant decimal and then converted back to double, then the final number must match the original.

The format is written with the significand having an implicit integer bit of value 1, unless the written exponent is all zeros. With the 52 bits of the fraction significand appearing in the memory format, the total precision is therefore 53 bits (approximately 16 decimal digits, 53 log10(2) ā‰ˆ 15.955). The bits are laid out as follows:

The real value assumed by a given 64-bit double-precision data with a given biased exponent e and a 52-bit fraction is or more precisely:

Between 252=4,503,599,627,370,496 and 253=9,007,199,254,740,992 the representable numbers are exactly the integers. For the next range, from 253 to 254, everything is multiplied by 2, so the representable numbers are the even ones, etc. Conversely, for the previous range from 251 to 252, the spacing is 0.5, etc.

The spacing as a fraction of the numbers in the range from 2n to 2n+1 is 2nāˆ’52. The maximum relative rounding error when rounding a number to the nearest representable one (the machine epsilon) is therefore 2āˆ’53.

Read more about this topic:  Double-precision Floating-point Format