Skip to content
Snippets Groups Projects
Commit 491a9d1f authored by Benjamin Cumming's avatar Benjamin Cumming
Browse files

add cmath header to fix os x compilation

parent 4ac05416
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ namespace nestmc { ...@@ -13,7 +13,7 @@ namespace nestmc {
T area_frustrum(T L, T r1, T r2) T area_frustrum(T L, T r1, T r2)
{ {
auto dr = r1 - 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> template <typename T>
......
#include <limits> #include <limits>
#include <cmath>
#include "gtest.h" #include "gtest.h"
...@@ -97,8 +98,8 @@ TEST(point, norm) ...@@ -97,8 +98,8 @@ TEST(point, norm)
point<double> p1(1, 1, 1); point<double> p1(1, 1, 1);
point<double> p2(1, 2, 3); point<double> p2(1, 2, 3);
EXPECT_EQ(norm(p1), sqrt(3.)); EXPECT_EQ(norm(p1), std::sqrt(3.));
EXPECT_EQ(norm(p2), sqrt(1.+4.+9.)); EXPECT_EQ(norm(p2), std::sqrt(1.+4.+9.));
} }
TEST(point, dot) TEST(point, dot)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment