My question is pretty straightforward and simple.
On a running program, could switching from one core to another on the same CPU, give rise to different results of the same set of values and instructions that encode the same float arithmetic operations?
I asked this because I had a program that was running with integer to double fixed calculations, and results changed after a few seconds of running and kept the new results for a few seconds as well. The change in results was extremely small, but I had no interpretation to it whatsoever.
EDIT:
- This is the exact code.
- Keep in mind that this is a window application using winapi.
- It is a test project for HID input readings.
- The data is being tested is BYTE winapi type, which is just an unsigned char.
- It receives value periodically from a polling HID after registration with RawInputAPI of Windows.
- It takes values from 0 to 255;
- All that I am doing is converting it to a double within the range -1.0 to 1.0;
CODE:
BYTE& InputValue = DIH_Data.bRawData[2];
int ivalue = 0;
double value = 0.0;
ivalue = InputValue - 128;
value = ((double)ivalue) / 128.0;
OutputDebugString(std::to_wstring(value).c_str());
OutputDebugString(L"\n");
RESULT:
- All readings are pretty consistent and are as expected;
- I have these two results, however:
- the first reading: 0.648430
- the other reading: 0.648438
- These seem to both arise from an input value of 83 out of 255. Why do they have different readings I have no idea.