title: Why does HALF_UP sometimes round down with double?
body: <p>The following code:</p>
  
  <pre><code>double doubleValue = 1713.6;
  float floatValue = 1713.6f;
  String fs = "%-9s : %-7s %-7s\n";
  System.out.printf( fs, "", "double", "float" );
  
  DecimalFormat format = new DecimalFormat("#0");
  System.out.printf( fs, "toString", String.valueOf( doubleValue ), String.valueOf( floatValue ) );
  
  format.setRoundingMode( RoundingMode.DOWN );
  System.out.printf( fs, "DOWN", format.format( doubleValue ), format.format( floatValue ) );
  
  format.setRoundingMode( RoundingMode.HALF_DOWN );
  System.out.printf( fs, "HALF_DOWN", format.format( doubleValue ), format.format( floatValue ) );
  
  format.setRoundingMode( RoundingMode.HALF_UP );
  System.out.printf( fs, "HALF_UP", format.format( doubleValue ), format.format( floatValue ) );
  
  format.setRoundingMode( RoundingMode.UP );
  System.out.printf( fs, "UP", format.format( doubleValue ), format.format( floatValue ) );
  </code></pre>
  
  <p>Produces the result (<a href="https://ideone.com/ZohDaA" rel="nofollow">live code</a>):</p>
  
  <pre><code>          : double  float  
  toString  : 1713.6  1713.6 
  DOWN      : 1713    1713   
  HALF_DOWN : 1714    1714   
  HALF_UP   : 1713    1714   &lt;--- notice this line
  UP        : 1714    1714   
  </code></pre>
  
  <p>I know that certain numbers cannot be represented exactly as floating-point numbers. The actual floating-point representation for 1713.6 is 1713.5999755859375 (see <a href="http://www.h-schmidt.net/FloatConverter/IEEE754.html" rel="nofollow">this page</a>).</p>
  
  <p>But <strong>why does HALF_UP round <em>down</em> in this case?</strong></p>
  
  <p>Using Java 1.8u25</p>