use c++ cast style: static_cast< double >( ( *msg ) / curTime );