I'm taking an intro to Java class that asks the following question:
Select the primitive type of this expression's result: 32.0 % 6 choices: int, float, double, long
I chose float, but the correct answer is double. I don't understand; 32.0 % 6 = 2.0, which falls within the ranges of both float and double. Why is one right and the other wrong?
The explanation given is "The 6 is promoted from an int to a double, which then leads to a double result."