title: Generating a random double between a range of values
body: <p>Im currently having trouble generating random numbers between -32.768 and 32.768. It keeps giving me the same values but with a small change in the decimal field. ex : 27.xxx.</p>
  
  <p>Heres my code, any help would be appreciated.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;ctime&gt;
  #include &lt;cstdlib&gt;
  
  using namespace std;
  
  int main()
  {
      srand( time(NULL) );
      double r = (68.556*rand()/RAND_MAX - 32.768);
      cout &lt;&lt; r &lt;&lt; endl;
      return 0;
  }
  </code></pre>