title: Generate random numbers uniformly over an entire range
body: <p>I need to generate random numbers within a specified interval, [max;min].</p>
  
  <p>Also, the random numbers should be uniformly distributed over the interval, not located to a particular point.</p>
  
  <p>Currenly I am generating as:</p>
  
  <pre><code>for(int i=0; i&lt;6; i++)
  {
      DWORD random = rand()%(max-min+1) + min;
  }
  </code></pre>
  
  <p>From my tests, random numbers are generated around one point only.</p>
  
  <pre><code>Example
  min = 3604607;
  max = 7654607;
  </code></pre>
  
  <p>Random numbers generated:</p>
  
  <pre><code>3631594
  3609293
  3630000
  3628441
  3636376
  3621404
  </code></pre>
  
  <p>From answers below: OK, RAND_MAX is 32767. I am on C++ Windows platform. Is there any other method to generate random numbers with a uniform distribution?</p>