title: How to calculate integer expression in Java
body: <p>Suppose, I need to calculate <code>3 * (2 / 3) = 2</code> but <code>3 * (2 / 3) = 0</code> in integer arithmetic. So, it looks like I should use floating-point arithmetic <code>3 * (2.0 / 3) = 2.0</code> and <em>cast</em> the floating point result to <code>int</code>. </p>
  
  <p>Does it make sense? How would you avoid casting here?</p>