title: nan when executing printf
body: <p>When I execute program</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  #include &lt;unistd.h&gt;
  
  double exponential(double u);
  
  double exponential(double u)
  {
      double a = (double)rand();
      return (-u * log(1.0 - a));
  }
  
  int main(void)
  {
      printf("%e\n",exponential(2.3));
      return 0;
  }
  </code></pre>
  
  <p>I obtain:</p>
  
  <pre><code>nan
  </code></pre>
  
  <p>Why?</p>