Quantcast
Channel: Why do I need 17 significant digits (and not 16) to represent a double? - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by Nemo for Why do I need 17 significant digits (and not 16) to represent a double?

$
0
0

I think the guy on that thread is wrong, and 16 base-10 digits are always enough to represent an IEEE double.

My attempt at a proof would go something like this:

Suppose otherwise. Then, necessarily, two distinct double-precision numbers must be represented by the same 16-significant-digit base-10 number.

But two distinct double-precision numbers must differ by at least one part in 253, which is greater than one part in 1016. And no two numbers differing by more than one part in 1016 could possibly round to the same 16-significant-digit base-10 number.

This is not completely rigorous and could be wrong. :-)


Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>