|
Re: How does division work?
If you add 0.5, it will "round" to the nearest integer:
int x = (int)(40/9 + 0.5); // 40/9 = 4.444 repeating and rounds down to 4
int y = (int)(40/6 + 0.5); // 40/6 = 6.666 repeating, rounds up to 7
__________________
What place are we at? ... TODAI!
|