svmsgd.cpp, fix #6248
authorberak <px1704@web.de>
Mon, 14 Mar 2016 07:02:09 +0000 (08:02 +0100)
committerberak <px1704@web.de>
Mon, 14 Mar 2016 07:02:09 +0000 (08:02 +0100)
add a cast to double, to make vs compilers happy

modules/ml/src/svmsgd.cpp

index ed452e3..ef5da6f 100644 (file)
@@ -153,7 +153,7 @@ void SVMSGDImpl::normalizeSamples(Mat &samples, Mat &average, float &multiplier)
 
     double normValue = norm(samples);
 
-    multiplier = static_cast<float>(sqrt(samples.total()) / normValue);
+    multiplier = static_cast<float>(sqrt(static_cast<double>(samples.total())) / normValue);
 
     samples *= multiplier;
 }