Understanding casts

Casts allow you to make comparisons between values of different data types or substitute a value of one data type for a value of another data type. For example, when you add a floating-point number to an integer, the computer must change (cast) the integer to a floating-point value before it can perform the addition.