Godot version:
3.1.
OS/device including version:
N/A
Issue description:
Consider these two lines of code, where damage is defined as an int var damage: int = 10.
damage *= 0.5
damage = damage * 0.5
The first statement returns 0. The second statement returns 5.
My understanding is that the two assignment statements should be the same. If they're not supposed to be, then this is not documented anywhere.
PROGRAMMER TALK:
Probably because damage *= 0.5 is converting the 0.5 to an int which results in it becoming 0.
This is a bug in the type preference of the operation,
EDIT: Seems to only happen when the variable has the int type hint, which makes this behaviour expected, might still be worth doing the conversion to int only after all computation.
That makes me vaguely think of https://github.com/godotengine/godot/issues/26332#issuecomment-467684334, but perhaps slightly different case
Most helpful comment
PROGRAMMER TALK:
Probably because damage *= 0.5 is converting the 0.5 to an int which results in it becoming 0.
This is a bug in the type preference of the operation,
EDIT: Seems to only happen when the variable has the int type hint, which makes this behaviour expected, might still be worth doing the conversion to int only after all computation.