title: Accurately finding the range of numbers generated?
body: <p>I am more than likely doing this whole code wrong, but when attempting the find the range of:</p>
  
  <p>4.0*rand()/RAND_MAX + 1</p>
  
  <p>I end up only getting the number 0 as a result, and I'm pretty sure there's more to it than that.</p>
  
  <p>Code (in C):</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  
  
  int main()
  {
  srand(time(NULL));
  
   int r;
   4.0*rand()/RAND_MAX+1;
   printf("%i",r);
  
  return 0;
  }
  </code></pre>