First page Back Continue Last page Graphics
Automatic Conversion
Type Casts
Some casting is good. You don't want to have to do it the “old fashioned way”
X = 2.5 + REAL(1) // old FORTRAN
When you say a float variable is assigned a mixed mode expression, you'd like the conversion to work automatically.
float x;
x = 2.5 + 1;
Convert the integer 1 to a float value 1.0 and add it to 2.5 using floating point addition.