Hi,
Anyone help me to find the control string for long double. I want to print the number as it is.
I wrote the following program
main()
{
long double d;
double d1;
d1 = (double)(double)999/(double)1000;
d=(double)(123456789012345+d1);
printf("\nd=%Lf\n",d);
}
For the above program, i am expecting the following result,
123456789012345.999
But i am getting the following output.
d=123456789012346.000000
What is the problem and how i will get the expected output. Please clarify. Thanks in advance.
Regards,
Ram
Anyone help me to find the control string for long double. I want to print the number as it is.
I wrote the following program
main()
{
long double d;
double d1;
d1 = (double)(double)999/(double)1000;
d=(double)(123456789012345+d1);
printf("\nd=%Lf\n",d);
}
For the above program, i am expecting the following result,
123456789012345.999
But i am getting the following output.
d=123456789012346.000000
What is the problem and how i will get the expected output. Please clarify. Thanks in advance.
Regards,
Ram