# IEEE 754-1985, Binary 64, Floating Point Number Examiner

Chris W. Johnson

April 27, 2018

All floating point numeric representations have limitations, so it’s vitally important to understand the effects of those limitations, especially if you’re writing software, and possibly even if you are merely using a spreadsheet.

The two principal issues with floating point are that (1) it sacrifices precision in order to preserve magnitude, and (2) in most cases (as in this case), the components of the floating point number are handled as conventional binary quantities (as opposed to binary representations of base 10 digits), while being accepted-from, and presented-to, humans as approximate conversions to base 10 (decimal) numbers. It is hoped that this tool will assist people in building an understanding of the causes and effects of such issues.

The “IEEE 754-1985,
binary 64” format is a very common floating point format used by
Java to represent numbers in its
`double`

primitives and `Double`

objects, and for all floating point calculations. By extension, it will be used to represent double-precision
floating point values in any of the other languages that run inside the
Java Virtual Machine (JVM). It is also used by
languages unrelated to Java and the JVM, notably Javascript,
which uses it to represent essentially all numbers,
Python which uses it on most platforms,
and C/C++ which use it where it is the host CPU’s native representation.

Floating Point Format | IEEE 754-1985, binary 64 | |
---|---|---|

Value, Typical Text Representation (Decimal) | ||

Value, Actual, Binary | Bits 63-0 | ${\mathrm{}}_{2}$ |

Value, Actual, Hexadecimal | Bits 63-0 | ${\mathrm{}}_{16}$ |

Sign | Bit 63 | |

Exponent | Bits 62-52 | |

Mantissa Leading Bit | Implicit | |

Mantissa | Bits 51-0 | |

Value Calculation | = Full Precision Result ≅ (single precision result) |

## Change the Bits and See What Happens…

Click on the bits to toggle their values. This page updates immediately.

± | Exponent | Mantissa | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|

— | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |

## Conventions:

- All hexadecimal and binary numbers are displayed in big-endian format.
- Bits are numbered from zero to 63 (inclusive), with bit 63 (the highest-order, or most significant, bit) being the left-most bit.
- Hexadecimal numbers are prefixed with “0x”, or suffixed with a subscripted “16”.
- Where they save space, hexadecimal (rather than decimal) numbers are used in the formulas shown here.
- Steps required to transform a number into the value used in the final Floating point calculation are separated with right arrow (“➔”) symbols. (It’s not enough to know the layout of the bits in the number, there are rules governing what’s done with those bits. The transformations are the manifestations of the rules applicable to the various bit fields.)
- The symbol “^” is used to indicate that the number prior to it should be raised to the power of the number after it.