I've been browsing through some Android source code and I noticed they set float values to 0 using 0.0f. I know that just 0 is an int that is then implicitly converted to float and that 0.0 is a double, but to my knowledge 0f is the same as 0.0f. Why would they go through the effort to type the extra .0 ? :)
There's no reason other than style. 0f and 0.0f are identical values. Details in JLS§3.10.2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With