For example, these variables:
result (double)
a (double)
b (float)
c (float)
d (double)
A simple calculation:
result = a * (b + c) * d
How and when are the types converted and how do I figure out what precision each calculation is performed at?
You have parenthesis delimiting the float adition. So it would do b + c as float + float. Convert this to double for keeping largest precision, then multiply the double values.
However in such case where you want control over conversions, and not guessing: use
static_cast<>()
;