Why does the following result in an output of zero:
Debug.Log(1/5);
And, actually, this will result in a value of 1:
Debug.Log(5/4);
It appears it is rounding floats to ints, but I didn’t explicitly tell it to do any such thing. And it isn’t just in Debug.Log. Any float or double variable, whose value should be set to a fraction, is rounding to an int.
It’s correct behavior. You’re only specifying ints, so gives you an int for the answer, which is normally what you want. Use floats, and you get a float.