1. ## -1.#ind00

What does -1.#IND00 mean??

2. It's Japanese for "I am a very large dinosaur with fourteen eyes"

3. OK then what does that have to do with the sin() function in math.h? I think that's what's causing the error.

4. sins are bad, god forgives you if you beg forgivness.

5. Thanks for the humor. It helps to be able to laugh even though you have 12 hours to finish 4 programs, and you've only had 1 class. UGHHHHH

6. What is that? is it an error code that's produced or what?

Post some code.....

7. OK.....

#include <stdio.h>
#include <math.h>

#define PI 3.141592654

double Foward(double x, double h);
double Central(double x, double h);

void main()
{
double x, h, fxF, fxC;
x=1;

h=1/4;
fxF=Foward(x,h);

printf("The value of F prime of 1 using the foward difference formula is %lf \n\n", fxF);

fxC=Central(x,h);

printf("The value of F prime of 1 using the central difference formula is %lf\n\n", fxC);

}

double Foward(double x, double h)
{
double x0, h0, fx, fxh, fprime;
x0=x;
h0=h;

fx=sin(PI*x0);
fxh=sin(PI*(x0+h0));

fprime=(fxh-fx)/h;

return fprime;
}

double Central(double x, double h)
{

double fprime, x0, h0, fxh1, fxh2;
x0=x;
h0=h;

fxh1=sin(PI*(x0+h0));
fxh2=sin(PI*(x0-h0));

fprime=(fxh1-fxh2)/(2*h);

return fprime;

}

This produces

The value of F prime of 1 using the foward difference formula is
-1.#IND00

The value of F prime of 1 using the central difference formula is
-1.#IND00

8. I have no idea about the bug, but use INT MAIN! (I formatted the code so people who can help have an easier time)

Code:
```#include <stdio.h>
#include <math.h>

#define PI 3.141592654

double Foward(double x, double h);
double Central(double x, double h);

int main(void)
{
double x, h, fxF, fxC;
x=1;
h=1/4;
fxF=Foward(x,h);
printf("The value of F prime of 1 using the foward difference formula is %lf \n\n", fxF);
fxC=Central(x,h);
printf("The value of F prime of 1 using the central difference formula is %lf\n\n", fxC);
return 0;
}

double Foward(double x, double h)
{
double x0, h0, fx, fxh, fprime;
x0=x;
h0=h;
fx=sin(PI*x0);
fxh=sin(PI*(x0+h0));
fprime=(fxh-fx)/h;
return fprime;
}

double Central(double x, double h)
{
double fprime, x0, h0, fxh1, fxh2;
x0=x;
h0=h;
fxh1=sin(PI*(x0+h0));
fxh2=sin(PI*(x0-h0));
fprime=(fxh1-fxh2)/(2*h);
return fprime;
}```

9. I dont know exactly what you are doing, but if you substitute

h=1/4;

for

h=(double)1/4;

...it seems happier....

Still I dont know if the answers given are correct....

10. OH Yea!!! That actually solved the problem!! Thank you so much.

11. > h=1/4;
Which would be performed using integer math, giving you the result of 0 (due to truncation), and no doubt the subsequent use of zero was causing grief (perhaps divide by 0)

http://homepages.borland.com/efg2lab...matics/NaN.htm

> What does -1.#IND00 mean??

I think it means INDefinite (which might also mean denormalised - see the other link)