I'm not sure when I have to worry about overflows when using unsigned chars. This case is clear:
uint8_t a = 3;
uint8_t b = 6;
uint8_t c = a - b; // c is 253
However, what happens here:
float d = a - b; // d is -3
Are both a and be converted to float before doing the subtraction?
Or also in this case:
float e = (a - b) + (a - c);
Are all three variables converted to float?
Are there possible cases where an overflow can occur, even when the variable being assigned to is a float? Are the rules the same if e is a float, or int, or anything else?
Also, what happens in a case like this:
int a = std::abs(a - b);