If you are dividing int values, you must cast them to doubles if the receiving variable is a double.
For example, this will result in "0":
int x = 1;
int y = 2;
double z = x / y;
Where this will result in the expected 0.5:
int x = 1;
int y = 2;
double z = (double)x / (double)y;