As in C, you can use both float methods and then round the result using a rounding function that takes a float as input.
int a = 1; int b = 2; float result = (float)a / (float)b; int rounded = (int)(result+0.5f); i
Nathan Garabedian Feb 07 2018-11-11T00: 00Z
source share