I've written a function for calculating the standard deviation and the result is always '1.#QNAN0', I've tried formatting it in different ways but I can't find a solution. It was working on a different computer yesterday, is there anything I can do?
void CalcStandardDeviation(int count, int* nums, double mean, FILE* output){
int k;
double std=0,a;
for (k=0; k<count; k++){
a=nums[k]-mean;
std=std+(a*a);
}
std/=(count);
std=sqrt(std);
fprintf(output,"Standard deviation: %f\r\n",std);
fprintf(output,"\r\n");
}