Just setting 1.0 should be enough to force c++ to take it as a double (standard default is double). Does msvc do differently? If casting,  static_cast<double>(1) is the correct c++ way to do it.