[mlpack-git] master: Fix clang warning when using integer absolute value function 'abs' when argument is of floating point type. (d7287ac)

gitdub at mlpack.org gitdub at mlpack.org
Thu Jul 7 18:21:37 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/448b5a86904abd266316eecc72eadc860825799d...d7287ac8851d399a1e94bf1b66ead70800c87cf4

>---------------------------------------------------------------

commit d7287ac8851d399a1e94bf1b66ead70800c87cf4
Author: Marcus Edel <marcus.edel at fu-berlin.de>
Date:   Fri Jul 8 00:21:37 2016 +0200

    Fix clang warning when using integer absolute value function 'abs' when argument is of floating point type.


>---------------------------------------------------------------

d7287ac8851d399a1e94bf1b66ead70800c87cf4
 src/mlpack/tests/test_tools.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mlpack/tests/test_tools.hpp b/src/mlpack/tests/test_tools.hpp
index 77fd1c1..7b5edcc 100644
--- a/src/mlpack/tests/test_tools.hpp
+++ b/src/mlpack/tests/test_tools.hpp
@@ -37,6 +37,6 @@
 // Require the approximation L to be within a relative error of E respect to the
 // actual value R.
 #define REQUIRE_RELATIVE_ERR( L, R, E ) \
-    BOOST_REQUIRE_LE( abs((R) - (L)), (E) * abs(R))
+    BOOST_REQUIRE_LE( std::abs((R) - (L)), (E) * std::abs(R))
 
 #endif




More information about the mlpack-git mailing list