An integer divided by an integer results in an integer. The fractional part (anything behind the dot) of the division is simply dropped, no rounding occurs. For example, 6/7 is 0.857... but since the fractional part is dropped, 0 is returned. If you need the fractional part you need to make that variable a float.