Data Types of Expressions
Same-type operands: result inherits the type.
7 + 3 is integer; 2.3 + 4.56 is float
Mixed-type operands: result is of type that is more general.
7 + 3.0 is float; 5.0 / 2 is float
What is 5 / 2? 20 / 3?
Previous slide
Next slide
Back to first slide
View graphic version