According to the task description you should not apply round operation. 
static_cast< long unsigned int >( d * 1000 ) apply floor operation implicitly.