diff --git a/Modules/Learning/Supervised/test/otbMachineLearningRegressionTests.cxx b/Modules/Learning/Supervised/test/otbMachineLearningRegressionTests.cxx
index 70330c391e4e508c5eb8d3e121d32e03c5c3f741..f54a9a96adc5a60f18f2a2411ff0e078ad5aba6d 100644
--- a/Modules/Learning/Supervised/test/otbMachineLearningRegressionTests.cxx
+++ b/Modules/Learning/Supervised/test/otbMachineLearningRegressionTests.cxx
@@ -211,7 +211,7 @@ int testRegression(SampleGeneratorType& sg, RegressionType& rgrsn, RegressionTes
     //typename SampleGeneratorType::PrecisionType invalue = sampleIt.GetMeasurementVector()[0];
     typename SampleGeneratorType::PrecisionType prediction = rgrsn->Predict(sampleIt.GetMeasurementVector())[0];
     typename SampleGeneratorType::PrecisionType expected = resultIt.GetMeasurementVector()[0];
-    rmse += pow(prediction - expected, 2.0);
+    rmse += std::pow(prediction - expected, static_cast<PrecisionType>(2.0));
     ++sampleIt;
     ++resultIt;
     }