You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue description:
Editor math (i.e. type 1*2 in transform position) is awesome. But if a number contains only integers you get the wrong result if it should be a float; it always rounds it to a integer.
Steps to reproduce: 1/2.0 == 0.5 1/2 == 0 (Wrong)
But conversely, if the input has a float in, you get back an integer. 2*0.5 == 1 1/0.5 == 2
Rounding float results to integers if the two inputs are integers is rarely going to be the desired outcome. While it can be worked around, it's non-obvious what's going on (I only recognised it quickly because I've seen it before.)
Minimal reproduction project:
The text was updated successfully, but these errors were encountered:
If you type only integers, you get integers back (there are no "float results" involved). This is working as expected imho.
What do you type into a calculator when you want to halve something?
x / 2
x * 0.5
x / 2.0
99% of people will type the first. They will then blindly assume the result is correct.
This is a calculator, it is not working as most people would expect a calculator to work.
@KoBeWi - It may be as intended but I maintain it's still a bug, albeit one of design not implementation. This interface is a tool, not a (over-strictly-typed) programming language, see my calculator example above.
Godot version:
3.2.3
OS/device including version:
Win 7
Issue description:
Editor math (i.e. type 1*2 in transform position) is awesome. But if a number contains only integers you get the wrong result if it should be a float; it always rounds it to a integer.
Steps to reproduce:
1/2.0
== 0.51/2
== 0 (Wrong)But conversely, if the input has a float in, you get back an integer.
2*0.5
== 11/0.5
== 2Rounding float results to integers if the two inputs are integers is rarely going to be the desired outcome. While it can be worked around, it's non-obvious what's going on (I only recognised it quickly because I've seen it before.)
Minimal reproduction project:
The text was updated successfully, but these errors were encountered: