Java int cast returns 0
<p>I have the following code:</p>

<pre><code>int i = (int) 0.72;
System.out.println(i);
</code></pre>

<p>Which yields the following output:</p>

<pre><code>0
</code></pre>

<p>I would of imagined that the variable <code>i</code> should have the value of <code>1</code> <em>(since 0.72 > 0.5 => 1)</em>, why is this not the case?</p>

<p><em>(I imagine that when casting to int, it simply cuts of the decimal digits after the comma, not taking into account of rounding up; so I'll probably have to take care of that myself?)</em></p>
