I am trying to do a calculation where I need to convert a float number to a double to obtain added precision in a chain calculation. I seem to have encountered a problem. It appears that the following does not work as expected:
TestFloat = 20.03564;
Test = (double)TestFloat;
When I look in the debugger, TestFloat shows the correct value. But, Test shows a value of 20.035642623901367.
If I run the following:
Test = 20.03564;
The debugger shows the exact value as a double.
What is happening?