Precision to drand48
<p>How can I add precision to drand48() in C++?
I am using it in a function like: </p>

<pre><code>double x = drand48()%1000+1;
</code></pre>

<p>to generate numbers below 1000.
But then I get this error:</p>

<pre><code>error: invalid operands of types ‘double’ and ‘int’ to binary ‘operator%’
</code></pre>

<p>This does not happen when I use:</p>

<pre><code>double x = rand()%1000+1;
</code></pre>

<p>Why and what is the difference between rand() and drand48()?</p>
