I am coding in Qt C++.
I am declaring a literal double value in my main rountine of 0.1. I then pass this variable to a function that takes type double. When I hover the mouse over the variable in debug mode I see 0.100000000000001
What is the cause of this change and how do I stop it please?
Method Definition:
void MyClass::MyMethod(double fNewCellSize)
{
// variable fNewCellSize appears as 0.10000000000001
}
Method Call with literal value of 0.1:
MyObj.MyMethod(0.1);
My environment is Windows 64 bit OS using Qt 5.2.1 and compiling using Microsoft 2010 Visual Studio compiler in 32 bit.