Skip to content
Permalink
Browse files

Fix compile errors on centos (#2005)

  • Loading branch information...
jackgerrits committed Aug 12, 2019
1 parent f2bcefa commit 95525d1f4423c27ee8d455029326362b3476a0e5
Showing with 3 additions and 2 deletions.
  1. +3 −2 vowpalwabbit/parse_regressor.cc
@@ -16,6 +16,7 @@ using namespace std;
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <stdarg.h>
#include <numeric>
@@ -74,9 +75,9 @@ void truncate(vw& all, T& weights)
{
static double sd = calculate_sd(all, weights);
for_each(weights.begin(), weights.end(), [](float& v) {
if (abs(v) > sd * 2)
if (std::fabs(v) > sd * 2)
{
v = (float)std::remainder(v, sd * 2);
v = (float)std::remainder(static_cast<double>(v), sd * 2);
}
});
}

0 comments on commit 95525d1

Please sign in to comment.
You can’t perform that action at this time.