title: boost::random and boost:uniform_real works with doubles not with floats?
body: <p>Pardon me if this has been discussed already. I've got a template function which uses boost::uniform_int and boost::uniform_real depending on the template argument and should return the same type:</p>
  
  <pre><code>template &lt;typename N&gt; N getRandom(int min, int max)
  {
    timeval t;
    gettimeofday(&amp;t,NULL);
    boost::mt19937 seed((int)t.tv_sec);
    boost::uniform_int&lt;&gt; dist(min, max);
    boost::variate_generator&lt;boost::mt19937&amp;, boost::uniform_int&lt;&gt; &gt; random(seed, dist);
    return random(); 
  }
  //! partial specialization for real numbers
  template &lt;typename N&gt; N getRandom(N min, N max)
  {
    timeval t;
    gettimeofday(&amp;t,NULL);
    boost::mt19937 seed( (int)t.tv_sec );
    boost::uniform_real&lt;&gt; dist(min,max);
    boost::variate_generator&lt;boost::mt19937&amp;, boost::uniform_real&lt;&gt; &gt; random(seed,dist);
    return random(); 
  }
  </code></pre>
  
  <p>Now I've tested the function with int, float and doubles.
  It works fine with int, it works fine with double, but it does not work with floats. It's as if it either translates a float as an int, or there is some casting problem. Reason I'm saying this is because when i do:</p>
  
  <pre><code>float y = getRandom&lt;float&gt;(0.0,5.0);
  </code></pre>
  
  <p>I always get an int back.
  However, like I said, it works with doubles.
  Is there something I'm doing wrong or missing ?
  Thank you !</p>