Strange error while doing a multiplication in java?
<pre><code>public static int NUM_FRAMES = 8;
public static int FRAME_REPEAT_NO = 2;
int height = 24;
//bitmap.getWidth() is 168 and bitmap.getHeight() is 91

double w = bitmap.getWidth();
w = w/NUM_FRAMES;
w = w*FRAME_REPEAT_NO;
w = w*height;
w = w/bitmap.getHeight();
</code></pre>

<p>I do this and i get the value of <code>w</code> as 11.07 which is correct.</p>

<p>But when i do this:</p>

<pre><code>double w  = FRAME_REPEAT_NO*(bitmap.getWidth()/NUM_FRAMES)*(height/bitmap.getHeight());
</code></pre>

<p>value of <code>w</code> is always 0;</p>

<p>Can someone explain to me why this is happening?</p>

<p>P.S. I'm doing it in an android app... </p>
