Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
da35a19a
Commit
da35a19a
authored
Oct 21, 2016
by
Matthieu Schaller
Browse files
fabsf() not abs() when dealing with floats
parent
081f101e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cooling/const_du/cooling.h
View file @
da35a19a
...
...
@@ -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
/
f
abs
f
(
cooling_rate
);
}
/**
...
...
src/cooling/const_lambda/cooling.h
View file @
da35a19a
...
...
@@ -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
/
f
abs
f
(
du_dt
);
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment