From 76b13c42bcaa1cdf49dcd8032d8b6d368000e612 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Mon, 16 Jun 2014 13:04:22 +0200 Subject: [PATCH] [util][math] Add the conversion to double (C++11 approach) before passing the integral argument to std::sqrt() --- include/boost/geometry/util/math.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/geometry/util/math.hpp b/include/boost/geometry/util/math.hpp index 762e0b4f8..89f4578c0 100644 --- a/include/boost/geometry/util/math.hpp +++ b/include/boost/geometry/util/math.hpp @@ -25,6 +25,7 @@ #include #include +#include #include @@ -154,7 +155,7 @@ struct square_root // Note: in C++98 the only other possibility is double; // in C++11 there are also overloads for integral types; // this specialization works for those as well. - return std::sqrt(value); + return std::sqrt(boost::numeric_cast(value)); } };