Home Segments Index Top Previous Next

67: Mainline

When arithmetic expressions contain a mixture of data types, they are called mixed expressions. The general rule about mixed expressions is that C++ attempts to convert one number into another in a way that does not lose information. Thus, when given a mixed expression that multiplies a floating-point number by an integer, C++ converts the integer into a floating-point number first, before multiplying.