I just have written my very first C code, and, as everybody else, got an error during compiling.
on terminal (linux, ubuntu):
gcc hwe.c -lm hwe
gcc: hwe: No such file or directory
In file included from hwe.c:2:
/usr/include/math.h:31:20: error: _mingw.h: No such file or directory
I believe that is something related to the math.h library. How do I fix that?
I will be really grateful for any tips.
The code is a very simple statistical test used in genetics:
int x, n;
float chi2 = 0;
for (x = 1; x <= 3 ; x++)
printf("Enter a count:");
scanf("%d" , &genotype[x]);
n = genotype+genotype+genotype;
f_A = ((2*genotype)+(genotype))/(n*2);
expected = pow(f_A,2)*n;
expected = 2*(f_A)*(1-f_A)*n;
expected = pow(1-f_A,2)*n;
for (x = 1; x <= 3; x++)
chi2 = chi2 + (pow((genotype[x]-expected[x]),2)/(expected[x]));
printf("The chi2 value is: %f", chi2);