correcting static_cast<double>