use static_cast<double>() instead of (double)