Simple equation not calculating as expected


<pre class="lang-java prettyprint-override"><code>System.out.println(300 + ((160 - 300) / (240 - 20)) * (27 - 20));
//Should print 295.5 but prints 300

System.out.println(300 + ((160 - 300) / (240 - 20)) * (26 - 20));
//Should print 296.1 but prints 300
</code></pre>

<p>I can't seem to figure out what's going wrong with this simple equation. I've tried storing the variable in <strong>ints</strong>, <strong>doubles</strong>, and <strong>floats</strong> then printing it out, and I still get 300.</p>

<p>I have put the equation into different calculators like Google and <a href="http://web2.0calc.com/" rel="nofollow">http://web2.0calc.com/</a>, and they produce the correct answers.</p>

<p>Please help me.</p>
