title: Java typecasting for retrieving integer part of a double as double
body: <p>I sometimes tend to use (double)(long)(a*b/c)   to store the integer part of the result as double. This works well for negative numbers too.</p>
  
  <p>Is there any better way to achieve the same thing as I believe typecasting is a costly operation.</p>
  
  <p>Please note I'm looking for Integer part of the number and not the rounded value.
  For eg :</p>
  
  <pre><code>MyObj.setDouble((double)(long)(522.99))
  MyObj.getDouble() returns 522.0 and not 523.0
  </code></pre>
  
  <p>Thanks.</p>