-
Do only double precision arithmetic. It's getting rounded if you convert to single precision.
Code:
const double g=.0000000000667;
double whatever, result
float someval;
result = whatever * g * convert(someval);
Note that most implementations of C and C++ don't do a good job of casting single to double - that's why:
Code:
double convert(float in){
double tmp;
char start[25], *end;
memset(start,0x00, sizeof(start));
sprintf(start,"%f",in);
end=s;
return strtod(s,&end);
}
-
thanks! :cool: I'll give that a run :)