From da35a19a134596e7243573e893ce0429837ec047 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <matthieu.schaller@durham.ac.uk> Date: Fri, 21 Oct 2016 07:44:25 +0100 Subject: [PATCH] fabsf() not abs() when dealing with floats --- src/cooling/const_du/cooling.h | 2 +- src/cooling/const_lambda/cooling.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cooling/const_du/cooling.h b/src/cooling/const_du/cooling.h index e7f4f27db7..448af9c376 100644 --- a/src/cooling/const_du/cooling.h +++ b/src/cooling/const_du/cooling.h @@ -103,7 +103,7 @@ __attribute__((always_inline)) INLINE static float cooling_timestep( const float cooling_rate = cooling->cooling_rate; const float internal_energy = hydro_get_internal_energy(p, 0); - return cooling->cooling_tstep_mult * internal_energy / abs(cooling_rate); + return cooling->cooling_tstep_mult * internal_energy / fabsf(cooling_rate); } /** diff --git a/src/cooling/const_lambda/cooling.h b/src/cooling/const_lambda/cooling.h index ffa1b9945b..1caf49bff1 100644 --- a/src/cooling/const_lambda/cooling.h +++ b/src/cooling/const_lambda/cooling.h @@ -117,7 +117,7 @@ __attribute__((always_inline)) INLINE static float cooling_timestep( /* Get current internal energy (dt=0) */ const float u = hydro_get_internal_energy(p, 0.f); - return u / abs(du_dt); + return u / fabsf(du_dt); } /** -- GitLab