Regarding Type Conversion

float i; i = 1 + (float) 5 / (int) 2.0 ;

Considering the code above, the output of value i is 3.5. Now, I was wondering during the evaluation of division why float was given precedence. I mean why the result of division was 2.5 instead of 2?

because that's the rule. Look up C++ coercion rule.

hyperrobotix: float i; i = 1 + (float) 5 / (int) 2.0 ;

Considering the code above, the output of value i is 3.5. Now, I was wondering during the evaluation of division why float was given precedence. I mean why the result of division was 2.5 instead of 2?

when you mix data types, the compiler "promotes" all the lesser ones to the level of the "greatest" one.

For example:

[b]uint16_t var1 = 5;
uint32_t var2 = 10;
float var3 = 1.5;
[/b]
[b]Serial.print (var1 * var2 * var3);[/b]

will result in 75.0 (a float value);

var1 and var2 both get "promoted" to the type "float" so that when the calculation is done, it's actually doing this:

[b]Serial.print (float * float * float);[/b]

The math calculation order of operations is irrelevant.

Hope this helps.