How do you compute the squares? This program:
#include <stdio.h>
int main()
{
double a [] =
{
0.035679,
0.079935,
0.033320,
0.042424,
0.012387
};
double sum, square;
int n;
sum = 0.0;
for (n=0; n<sizeof(a)/sizeof(a[0]); ++n)
{
square = a[n]*a[n];
sum += square;
printf("%g ----> %g\n", a[n], square);
}
printf("sum of squares: %g\n", sum);
return 0;
}
gives:
0.035679 ----> 0.00127299
0.079935 ----> 0.0063896
0.03332 ----> 0.00111022
0.042424 ----> 0.0017998
0.012387 ----> 0.000153438
sum of squares: 0.0107261
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite