title: Simple division in Java - is this a bug or a feature?
body: <p>I'm trying this simple calculation in a Java application:</p>
  
  <pre><code>System.out.println("b=" + (1 - 7 / 10));
  </code></pre>
  
  <p>Obviously I expect the output to be <code>b=0.3</code>, but I actually get <code>b=1</code> instead.</p>
  
  <p>What?! Why does this happen?</p>
  
  <p>If I write:</p>
  
  <pre><code>System.out.println("b=" + (1 - 0.7));
  </code></pre>
  
  <p>I get the right result, which is <code>b=0.3</code>.</p>
  
  <p>What's going wrong here?</p>