wrong division in java
<p>I am dividing two int values, and im expecting to get a double one. but it works very strange, it has the correct values just before division but it doesnt give the right answer.</p>

<pre><code>    public void Analyse() {
        for (FlowPacket fp : this.flow.GetAll()) {
            if (fp.direction==1){
               this.sentPackets++;
               this.sentLength = this.sentLength + fp.packetLength;
            }
            else{
                this.receivedPackets++;
                this.receivedLength = this.receivedLength + fp.packetLength;
            }

        }
        if(this.receivedPackets==0)
                this.receivedPackets = 1;
    }


public double CalcRatio() {
            return (this.sentPackets/this.receivedPackets);
        }
</code></pre>

<p>----------------------------main--------------------------------</p>

<pre><code>System.out.print("Sent packets: " + analyser.getTotalSentPackets() + " , ");
System.out.print("Received packets: " + analyser.getTotalReceivedPackets() + " , ");
System.out.print("ratio: " + analyser.CalcRatio() + " , ");
</code></pre>

<p>----------------------------outout------------------------------</p>

<pre><code> Sent packets: 2694 , Received packets: 5753 , ratio: 0
</code></pre>
