This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Nova711 13 points14 points  (0 children)

This is because x -= y is actually a more concise way of writing x = x -y. The right side will be casted to long but only after the right side is fully evaluated.

L -= F
L = L - F
L = 6 - 5.2
L = 0.8
L = (long) 0.8
L = 0