Why doesn't (int) Math.random()*10 produce 10 in Java?
<p>Why the following produce between 0 - 9 and not 10?</p>

<p>My understanding is Math.random() create number between 0 to under 1.0.</p>

<p>So it can produce 0.99987 which becomes 10 by *10, isn't it?</p>

<pre><code>int targetNumber = (int) (Math.random()* 10);
</code></pre>
