When mixing integers with floating point types in arithmetic expressions, the result of the expression is always a floating point type.
If multiple floating point types are present, the result of the expression is the highest present floating point type: float, double or long double (in that order).
Compiler Explorer link: https://compiler-explorer.com/z/rn5Tnbh7r
@simontoth so hard to look at initialization of y with a value that is double, especially one that cannot be represented accurately.
My recommendation is to either always use suffix f or to not use floats, only doubles. Such simple lazyness can lead to crazy bugs.
Don't cause youself extra fp errors, you'll get enouth of them anyway :)
@aurisc4 Good point, one more reason for "almost always auto".