I'm really wasting a lot of time solving a problem in my code. Now it is working, but I do not understand what is going wrong.
Using QT5 / gcc
int pos;
uint m_endZeit, m_startZeit;
float secPerPx = (pos * (m_endZeit - m_startZeit)) / static_cast<float>(width());
uint a = secPerPx + m_startZeit;
uint b = static_cast<uint>(secPerPx) + m_startZeit;
std::cout << a << " vs. " << b << std::endl;
Output:
1404809856 vs. 1404809893
Can anyone explain this to me? Why is this not the same?