I have the following snippet
cout.precision(30);
long double d = 85952643841691072928.0;
cout << d << endl;
The print statement outputs 85952643841691074560
. Why are the last 4 digits before the decimal incorrect? A long double
should be capable of handling a number of this size?