title: 1.#QNAN0 output when calculating standard deviation C
body: <p>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?</p>
  
  <pre><code>void CalcStandardDeviation(int count, int* nums, double mean, FILE* output){
      int k;
      double std=0,a;
      for (k=0; k&lt;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");
     }
  </code></pre>