Commit da35a19a authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

fabsf() not abs() when dealing with floats

parent 081f101e
...@@ -103,7 +103,7 @@ __attribute__((always_inline)) INLINE static float cooling_timestep( ...@@ -103,7 +103,7 @@ __attribute__((always_inline)) INLINE static float cooling_timestep(
const float cooling_rate = cooling->cooling_rate; const float cooling_rate = cooling->cooling_rate;
const float internal_energy = hydro_get_internal_energy(p, 0); 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);
} }
/** /**
......
...@@ -117,7 +117,7 @@ __attribute__((always_inline)) INLINE static float cooling_timestep( ...@@ -117,7 +117,7 @@ __attribute__((always_inline)) INLINE static float cooling_timestep(
/* Get current internal energy (dt=0) */ /* Get current internal energy (dt=0) */
const float u = hydro_get_internal_energy(p, 0.f); const float u = hydro_get_internal_energy(p, 0.f);
return u / abs(du_dt); return u / fabsf(du_dt);
} }
/** /**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment