Both a and b are integers so a/b will do integer division (The result will be an integer). If that is not what you want you can cast one of the sides of the division to a double. c = floor(double(a) / b);
Note that if the quotient is positive the above will give you the same result as c = a / b;