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

Answer by BSalita for Why do I need 17 significant digits (and not 16) to...

The largest continuous range of integers that can be exactly represented by a double (8-byte IEEE) is -253 to 253 (-9007199254740992. to 9007199254740992.). The numbers -253-1 and 253+1 cannot be...

View Article



Answer by Olof Forshell for Why do I need 17 significant digits (and not 16)...

Dig into the single and double precision basics and wean yourself of the notion of this or that (16-17) many DECIMAL digits and start thinking in (53) BINARY digits. The necessary examples may be found...

View Article

Answer by Ondřej Čertík for Why do I need 17 significant digits (and not 16)...

The correct answer is the one by Nemo above. Here I am just pasting a simple Fortran program showing an example of the two numbers, that need 17 digits of precision to print, showing, that one does...

View Article

Answer by Nemo for Why do I need 17 significant digits (and not 16) to...

My other answer was dead wrong.#include <stdio.h>intmain(int argc, char *argv[]){ unsigned long long n = 1ULL << 53; unsigned long long a = 2*(n-1); unsigned long long b = 2*(n-2);...

View Article

Answer by Nemo for Why do I need 17 significant digits (and not 16) to...

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...

View Article


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

Can someone give me an example of a floating point number (double precision), that needs more than 16 significant decimal digits to represent it?I have found in this thread that sometimes you need up...

View Article
Browsing latest articles
Browse All 6 View Live




Latest Images

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