Decimal Arithmetic FAQ
Part 6 – Miscellaneous Questions 
When the exponent is zero, you need as many decimal digits as there are binary bits in the significand of the binary floatingpoint number (you get one power of two in each digit).
For example, the 64bit IEEE 754 binary floatingpoint format (often called a ‘double’) has a 53bit significand (52 bits explicit in the format and one implied). To represent this exactly needs 53 decimal digits.
Here’s a brief proofbyexample:
Consider the double which has all ones and an exponent of zero; that is, the binary fraction 1.1111111.... (53 one bits in all). That has the value 2^{0} + 2^{−1} + 2^{−2} + .... + 2^{−52}.
Now consider the first and last terms of that expansion:
2^{0} = 1
2^{−52} = 0.0000000000000002220446049250313080847263336181640625
The total must be less than 2, so the first term (1) provides the leftmost digit of the total. Also, no term is smaller than 2^{−52}, so there will be no digits further to the right than those of that term. The sum of these two terms is:
1.0000000000000002220446049250313080847263336181640625
which has 53 digits.
Using a power of two
Note, however, that if we can assume a multiplier of 2^{−52} then we can express the same number exactly instead of as a decimal fraction by using the expression
9007199254740991 × 2^{−52}
which needs only 16 digits. But, if the value2 ^{−52} is written out in decimal the expression becomes
9007199254740991 × 0.0000000000000002220446049250313080847263336181640625
There are 37 significant digits in the righthand term, again giving a total of 53 significant digits.
See also see item 2 in an earlier answer for a couple more examples where you need over 50 digits for the exact conversion of a binary double to a decimal fraction.
Nonzero exponents
Additional digits may be needed when the exponent is nonzero; probably up to 63 or 64 (again, one digit for each bit of information in the original number). Leading zeros (depending on the chosen format for the result) may also be needed.
As described in the last answer, representing a binary floatingpoint (BFP) number as an exact decimal number needs as many decimal digits as there are bits in the binary number.
However, far fewer are needed for a safe reversible conversion (that is, converting a BFP number to decimal and then back to BFP giving the identical BFP to that which one started with). For the 64bit IEEE 754 binary floatingpoint format (‘double’), it’s 17.
Why 17? Think of the significand as a 53bit integer. This can have (simplifying slightly, but erring on the safe side) 2^{53} different values. All we need to do is convert each of those values to a different decimal digit sequence (and ensure that converting back gives us the original binary integer). To do that we need a decimal number that can encode 2^{53} or more values.
2^{53} is 9007199254740992, which has 16 digits. To accomodate edge cases when taking into account the exponent it turns out one more digit than that is needed, which is 17 digits.
For more detail on this, see the Conversions section of links at the General Decimal Arithmetic page, especially Steele & White’s paper and others which cite it.
Please send any comments or corrections to Mike Cowlishaw, mfc@speleotrove.com 
Copyright © IBM Corporation 2000, 2007.
Parts © Mike Cowlishaw 1997, 2013.
All rights reserved.
