title: Integer division: How do you produce a double?
body: <p>For this code block:</p>
  
  <pre><code>int num = 5;
  int denom = 7;
  double d = num / denom;
  </code></pre>
  
  <p>the value of <code>d</code> is <code>0.0</code>. It can be forced to work by casting:</p>
  
  <pre><code>double d = ((double) num) / denom;
  </code></pre>
  
  <p>But is there another way to get the correct <code>double</code> result? I don't like casting primitives, who knows what may happen.</p>