9.0f + 8.0f
is the result a float
?
Yes, the type is float
.
First, if the corresponding real type of either operand is long double
, the other operand is converted, without change of type domain, to a type whose corresponding real type is long double
.
Otherwise, if the corresponding real type of either operand is double
, the other operand is converted, without change of type domain, to a type whose corresponding real type is double
.
Otherwise, if the corresponding real type of either operand is float
, the other operand is converted, without change of type domain, to a type whose corresponding real type is float
.
C23x dr § 6.3.1.8 1
Although the type is float
, depending on FLT_EVAL_METHOD
, the sum may have been calculated using float
, double
or long double
math. This potentially has arithmetic impact on a larger/different valued expression. This part is "compiler implementation defined behavior".