I'm seeing an odd issue in my code
In my mfc/c++ application, there is a function that gets called at 2 different points. Once, when a dialog/component is displayed. The second time is when some generation is happening from a 2nd dialog/component. The only difference is that from the 2nd dialog, the call is happening in a new thread.
Within this function, broken down to its simplest, 2 doubles are subtracted.
double a = -13.497999999999999
double b = 33.564999999999998
a - b
when I step through the code, I am getting different results from the subtraction and is having a knock on affect to other calculations. The result from Dialog 2 seems to be closer to what is valid.
Dialog 1 - 20.066999435424805
Dialog 2 - 20.067000000000000
Very odd that simple subtraction would return different results. The differences may be minimal, but they do build up to cause a larger problem.
using VS2010, settings all correct as far as I can tell.
I've tried using floats and long double's to see if that would resolve anything but they don‘t.