title: What is the most efficient way to round a float value to the nearest integer in java?
body: <p>I've seen a lot of discussion on SO related to rounding float values, but no solid Q&amp;A considering the efficiency aspect. So here it is: </p>
  
  <p>What is the most efficient (but correct) way to round a float value to the nearest integer? </p>
  
  <pre><code>(int) (mFloat + 0.5);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Math.round(mFloat);
  </code></pre>
  
  <p>or </p>
  
  <pre><code>FloatMath.floor(mFloat + 0.5);
  </code></pre>
  
  <p>or something else?</p>
  
  <p>Preferably I would like to use something available in standard java libraries, not some external library that I have to import.</p>