From 1b42fa20c6e2ec5cefb955f677c927c19677e0d5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 4 Sep 2018 07:26:57 -0500 Subject: [PATCH] Make sure to use std::fabs --- src/mesh.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index 88aa6af126..87d5f1e289 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -432,9 +432,9 @@ void RegularMesh::bins_crossed(const Particle* p, std::vector& bins, } for (j = 0; j < n; ++j) { - if (std::abs(u[j]) < FP_PRECISION) { + if (std::fabs(u[j]) < FP_PRECISION) { d(j) = INFTY; - } else if (u[j] > 0) { + } else if (u[j] > 0.0) { double xyz_cross = lower_left_[j] + ijk0(j) * width_[j]; d(j) = (xyz_cross - r0[j]) / u[j]; } else { @@ -473,7 +473,7 @@ void RegularMesh::bins_crossed(const Particle* p, std::vector& bins, // surface. xt::xtensor d = xt::zeros({n}); for (int j = 0; j < n; ++j) { - if (abs(u[j]) < FP_PRECISION) { + if (std::fabs(u[j]) < FP_PRECISION) { d(j) = INFTY; } else if (u[j] > 0) { double xyz_cross = lower_left_[j] + ijk0(j) * width_[j];