title: Unexpected result while dividing int by int and storing result into double
body: <p>I'm having a weird problem.</p>
  
  <p>This code simply divides an int by another int, stores result in a double variable and prints it:</p>
  
  <pre><code>int a = 200;
  int b = 557;
  
  double divisionResult = a / b;
  
  System.out.println("Result: " + divisionResult);
  </code></pre>
  
  <p>After executing this code, the output is:</p>
  
  <pre class="lang-none prettyprint-override"><code>Result: 0
  </code></pre>
  
  <p>This is weird, because <code>200/557</code> is <code>0.3590664272890485</code></p>
  
  <p>I noticed that if i cast <code>a</code> and <code>b</code> to <code>double</code> in the division line</p>
  
  <pre><code>double divisionResult = (double) a / (double) b;
  </code></pre>
  
  <p>It works perfectly.</p>
  
  <p>Why do i have to cast my variables to double to get the real division result?</p>