Subtraction of numbers double and long
<p>In my JAVA program there is code like this:</p>

<pre><code>int f_part = (int) ((f_num - num) * 100);
</code></pre>

<p>f_num is double and num is long. I just want to take the fractional part out and assign it to f_part. But some times f_part value is one less than it's value. Which means if f_num = 123.55 and num = 123, But f_part equals to 54. And it happens only f_num and num is greater than 100. I don't know why this happening. Please can someone explain why this happens and way to correct it.</p>
