diff --git a/src/math.hpp b/src/math.hpp index d936824966c59d18758f232bd4b351ce77cdeca1..5c3a00b4af2e54f388b40089a23486ae6e5c4a10 100644 --- a/src/math.hpp +++ b/src/math.hpp @@ -13,7 +13,7 @@ namespace nestmc { T area_frustrum(T L, T r1, T r2) { auto dr = r1 - r2; - return pi<double>() * (r1+r2) * sqrt(L*L + dr*dr); + return pi<double>() * (r1+r2) * std::sqrt(L*L + dr*dr); } template <typename T> diff --git a/tests/test_point.cpp b/tests/test_point.cpp index 9fbb62a2fd6819caf1e1b97a2c62013d98886f24..f2499d427fb56217ec98ff8694a446d4a4903229 100644 --- a/tests/test_point.cpp +++ b/tests/test_point.cpp @@ -1,4 +1,5 @@ #include <limits> +#include <cmath> #include "gtest.h" @@ -97,8 +98,8 @@ TEST(point, norm) point<double> p1(1, 1, 1); point<double> p2(1, 2, 3); - EXPECT_EQ(norm(p1), sqrt(3.)); - EXPECT_EQ(norm(p2), sqrt(1.+4.+9.)); + EXPECT_EQ(norm(p1), std::sqrt(3.)); + EXPECT_EQ(norm(p2), std::sqrt(1.+4.+9.)); } TEST(point, dot)