aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Carpet/src/Evolve.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-04-02 18:29:33 -0400
committerErik Schnetter <schnetter@gmail.com>2013-04-02 18:29:33 -0400
commit671c86c079faa37386f59eb3c814dc837c4df4c5 (patch)
tree0cf5baa5bb9dc44a05c0b8ea78d867c17d8c1e49 /Carpet/Carpet/src/Evolve.cc
parentc0c03fece68597fddfef57948334c5c99154f244 (diff)
Replace abs() by fabs()
Replace calls to abs() with floating arguments by calls to fabs(), to ensure the results are not accidentally truncated to integer.
Diffstat (limited to 'Carpet/Carpet/src/Evolve.cc')
-rw-r--r--Carpet/Carpet/src/Evolve.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/Carpet/Carpet/src/Evolve.cc b/Carpet/Carpet/src/Evolve.cc
index 8864ee9ee..4c97d13a9 100644
--- a/Carpet/Carpet/src/Evolve.cc
+++ b/Carpet/Carpet/src/Evolve.cc
@@ -110,15 +110,15 @@ namespace Carpet {
timer.start();
CCTK_REAL const eps =
pow(numeric_limits<CCTK_REAL>::epsilon(), CCTK_REAL(0.75));
- assert (abs (cctkGH->cctk_time - global_time) <= eps * global_time);
+ assert (fabs (cctkGH->cctk_time - global_time) <= eps * global_time);
for (int ml=0; ml<mglevels; ++ml) {
for (int rl=0; rl<reflevels; ++rl) {
int const do_every =
ipow (mgfact, ml) * (maxtimereflevelfact / timereffacts.AT(rl));
if (cctkGH->cctk_iteration % do_every == 0) {
- // assert (abs (leveltimes.AT(ml).AT(rl) - global_time) <=
+ // assert (fabs (leveltimes.AT(ml).AT(rl) - global_time) <=
// eps * global_time);
- assert (abs (tt->get_time(ml,rl,0) - global_time) <=
+ assert (fabs (tt->get_time(ml,rl,0) - global_time) <=
eps * global_time);
}
}