yup, You can prove the floating point has a trucation issue. But I need to prove the array will have different sum if it adds the first one to the last one and vice versa. I just want to find out the...
Type: Posts; User: Eric Cheong
yup, You can prove the floating point has a trucation issue. But I need to prove the array will have different sum if it adds the first one to the last one and vice versa. I just want to find out the...
The question is what is the value for a[i] that can make the result different from the two loops.
I have a floating point question. The following is the source code:
double sum, a[3];
int i;
sum = 0.0;
for (i=0; i < 3; i++)
sum += a[i];
printf("%e\n", sum);