Daily bit(e) of C++ | Mixing integral and floating point types
Daily bit(e) of C++ #278, Mixing integral and floating point types.
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).