(Apologies if the tag is incorrect. I can't find a "Multiplication" tag or similar)
I'm going to be adding a set of 5 numbers up and dividing them to get the average for a java game I am making.
However, there seems to be something wrong with it. I would have thought 15 + 15 / 2 would have been 15, however that seems incorrect.
However, 15 * 2 / 2 yields the expected result.
What is the difference here? Will doing counting up the variables and dividing them by the amount of variables work correctly in my game?