Skip to content

Commit

Permalink
abs -> std::abs
Browse files Browse the repository at this point in the history
warning: using integer absolute value function 'abs' when argument is of
floating point type [-Wabsolute-value]
  • Loading branch information
Alastair Quadros committed Mar 15, 2015
1 parent 04b4a56 commit 3645f0c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cpp/flann/algorithms/kdtree_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <cassert>
#include <cstring>
#include <stdarg.h>
#include <cmath>

#include "flann/general.h"
#include "flann/algorithms/nn_index.h"
Expand Down Expand Up @@ -663,7 +664,7 @@ class KDTreeIndex : public NNIndex<Distance>
ElementType max_span = 0;
size_t div_feat = 0;
for (size_t i=0;i<veclen_;++i) {
ElementType span = abs(point[i]-leaf_point[i]);
ElementType span = std::abs(point[i]-leaf_point[i]);
if (span > max_span) {
max_span = span;
div_feat = i;
Expand Down

0 comments on commit 3645f0c

Please sign in to comment.