Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix a typing issue around std::abs
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 14 May 2017 09:31:52 +0000 (11:31 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 14 May 2017 09:42:50 +0000 (11:42 +0200)
It seems that C++11 systems want std::abs for doubles, and C++17 ones
want std::fabs for that. So let's stick to the C version.

src/surf/trace_mgr_test.cpp

index 6c6c164..0ef287d 100644 (file)
@@ -16,6 +16,8 @@ namespace utf = boost::unit_test;
 #include "xbt/log.h"
 #include "xbt/misc.h"
 
+#include <math.h>
+
 XBT_LOG_NEW_DEFAULT_CATEGORY(unit, "Unit tests of the Trace Manager");
 
 double thedate;
@@ -31,7 +33,7 @@ public:
 
 static inline bool doubleEq(double d1, double d2)
 {
-  return std::abs(d1 - d2) < 0.0001;
+  return fabs(d1 - d2) < 0.0001;
 }
 class Evt {
 public: