title: C++ float number to nan
body: <p>I want to know what makes a float number nan in c++. I am using a large dataset and it is really hard to trace. I want to know the ways of changing a float number to nan to reduce bug possibilities.</p>
  
  <p>I found the code that causes the nan problem. I found that s/m is nan in some cases. But I don't know how to solve it.</p>
  
  <pre><code>float gp(float x){
  float e = 2.71828183;
  x *= -1;
  float s = pow(e,x);
  float m = (1 + pow(e,x)) * (1 + pow(e,x));  
  return s / m;}
  </code></pre>