Dear fellow stackoverflowers,
Is there some kind of guarantee that coercing a float type to a "wider" one, always yields the same result as performing the according static_cast?
Here an example:
float f = <any float>; double a = f; double b = static_cast<double>(f); // does this always hold? EXPECT_TRUE(a==b); Thank you for the information.
doublecan hold any value offloatif represented according to IEEE 754. There is therefore no loss of precision (no rounding, etc.).