Y
Yogesh Khanolkar
Hi,
I am getting incorrect o/p from the code below:
#include<stdio.h>
#include<float.h>
#include<limits.h>
main()
{
double val,val1;
val=123456789012.123456;
val1=123456789012.123456;
val2=val*val1;
printf("%f\n",val2);
}
The result I get is 15241578753183967100000.000000 instead of the correct value.
I am running on HP-UX 11 with ansi c compiler.
Can anyone let me know why I am getting this result.
I am getting incorrect o/p from the code below:
#include<stdio.h>
#include<float.h>
#include<limits.h>
main()
{
double val,val1;
val=123456789012.123456;
val1=123456789012.123456;
val2=val*val1;
printf("%f\n",val2);
}
The result I get is 15241578753183967100000.000000 instead of the correct value.
I am running on HP-UX 11 with ansi c compiler.
Can anyone let me know why I am getting this result.