+ 2
What's the difference between multiply by 5 and 5f?
Here's the code screenshot: https://camo.githubusercontent.com/f597d669c34f3e8d1d08dba0eeea612e48ad91b0/68747470733a2f2f692e696d6775722e636f6d2f326562574c6a442e706e67
4 ответов
+ 1
Positions tend to use floats and doubles, since you need precision. Using a float is the way to go, in that particular case.
+ 1
If you multiply by 5 you get an integer for example:
5 * 2 = 10
If you multiply with 5f(float) the result is for example
5f * 2 = 10 or
5.0f * 2 = 10 ..
+ 1
f for float