Know your variable types
Frequent source of errors is using wrong variable type in expressions
Wrong! But compiler would not report error
Must cast argument and result to right type
int y;
int x=2;
float z=2.0;
y=pow(x,z);
y=(int)pow((float)x,z);
Previous slide
Next slide
Back to first slide
View graphic version