title: Cast int to double then back to int in java
body: <p>quick question.</p>
  
  <p>Would this always be true?</p>
  
  <pre><code>int i = ...;
  double d = i;
  if (i == (int) d) ...
  </code></pre>
  
  <p>Or I need to do rounding to be sure?</p>
  
  <pre><code>if (i == Math.round(d)) ...
  </code></pre>