The problem is with rounding in the double numerical system. Since doubles are binaries, they cannot exactly represent all decimal numbers. If you really want to do it this way, you need to allow for this. for example your first test for the 45 minutes could be expressed as:

if( ( m_hourswork - 0.45 ) < 0.001 ) // 45 minutes worked

m_hourswork = 0.75.

I must say though that this is a really clumsy way of approaching your problem. MFC has some wonderful time handling functions. Why don't you check the CTime class?

if( ( m_hourswork - 0.45 ) < 0.001 ) // 45 minutes worked

m_hourswork = 0.75.

I must say though that this is a really clumsy way of approaching your problem. MFC has some wonderful time handling functions. Why don't you check the CTime class?