i need to count digits from a float number and keep the number. i can use scanf for %f or %c but not %s, and i can use getchar(). i can use ...
So, I'm trying to calculate a certain value to a rather large precision. The expression in C is:
long double t = 2.0L+.2L*(sp)+s.missRate*50L;
11.575345
11.575345222971968
I have to use C and Fortran together to do some simulations. In their course I use the same memory in both programming language parts, by defining a pointer in C ...
double atof(char s[]) { double val, power; int i, sign; for(i=0;isspace(s[i]); i++)// skip white space ; sign = (s[i] == '-') ? -1 : 1; if (s[i] == '+' || s[i] == '-') i++; for (val =0.0; isdigit(s[i]);i++) val = 10.0 * val + (s[i]-'0'); if (s[i] == '.') i++; for(power = 1.0; isdigit(s[i]); i++) { val = 10.0 * val ...