I need my program to return a high value of digits in the house with a maximum of 40 digits.
I've seen that the type DOUBLE
has a range from 1.7 x 10 ^ -308 to 1.7X10 ^ 308 , so I should think that it caters to my needs too much.
But when this simple program is started:
int main()
{
double p = 1234567890123456789012345678901234567890.0;
printf("%.0lf", p);
return 0;
}
See also Ideone
The return you get will be: 1234567890123456780000000000000000
How do you get around the problem in question?