In your expression, sb is int and sum is int, then the calculation result of 0. 1875 will be automatically converted into int, which is 0.
To get the correct result, you can cast it, such as: double a = (double) (sb/sum);
You can get floating-point data.