
Type Checking 175
This is called type coercion. Further, we may even drop the cast in the call argument:
int i;
float a;
a = sin(i);
This is called type promotion, i.e., i of type integer is promoted to type double. In both these
cases, implicit type casting is involved and the compiler must detect it and insert appropriate type
conversion code in the compiled code.
6.7 Overloading of Operators and Functions
Operator overloading, so popular in C++, is a way to implement polymorphism for some of the unary
and binary operators in a language. The overloading operates at two levels. For example, consider
the four arithmetic operators +, −, * and /. ...