Implicit type conversion rules in C++ operators

I want to be better about knowing when I should cast. What are the implicit type conversion rules in C++ when adding, multiplying, etc. For example,

int + float = ?
int * float = ?
float * int = ?
int / float = ?
float / int = ?
int / int = ?
int ^ float = ?

et cetera…

Will the expression always be evaluated as the more precise type? Do the rules differ for Java?
Please correct me if I have worded this question inaccurately.

9 Answers
9

Leave a Comment