Why has '32' been added to the value of v in the output below?
int main()
{
float v = 9.999e8;
std::cout << "v --> " << v << std::endl;
std::cout << std::fixed;
std::cout << "v --> " << v << std::endl;
return 0;
}
output:
v --> 9.999e+08
v --> 999900032.000000
^^
Is it an artefact of printing the value, or that 9.999e+08 cannot be accurately represented in a float?
Changing v to a double resolves the issue but I want to understand the actual cause.
strong text