frustrating arithmetic



hi all,
i am looking forward to finding someone who could help me out. from
the following code,
i get 45 for the variable "numSusceptible" and 50 for "numNode". and
then i get 5 for "(numNodes - numSusceptible)". however, i get zero
when i calculate "(numNodes - numSusceptible) / numNodes". i don't
understand what is going on here. I would appreciate it if anyone
could help me understand. many thanks in advance.



private void getPrevalence() {
double prevalence = 0;
int numSusceptible = 0;
String string;
for (int i = 0; i < numNodes; i++) {
GayNode iNode = (GayNode) agentList.get(i);
string = iNode.getInfectStatus();
System.out.printf("status = %s ", string);
if (string.equals("s")) {
numSusceptible += 1;
}
}
prevalence = (numNodes - numSusceptible) / numNodes;
System.out.printf("\nSusceptibles = %d ", numSusceptible);
System.out.printf("numNodes = %d ", numNodes);
System.out.printf("prevalence =%.4f \n", prevalence);
//return prevalence;
}I

.