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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleWhy 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