aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetInterp2
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/CarpetInterp2
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/CarpetInterp2')
-rw-r--r--Carpet/CarpetInterp2/src/fasterp.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/Carpet/CarpetInterp2/src/fasterp.cc b/Carpet/CarpetInterp2/src/fasterp.cc
index fc3ac8a90..3230ba751 100644
--- a/Carpet/CarpetInterp2/src/fasterp.cc
+++ b/Carpet/CarpetInterp2/src/fasterp.cc
@@ -1190,12 +1190,12 @@ namespace CarpetInterp2 {
assert (all (ipos % ext.stride() == ivect(0)));
ipos /= ext.stride();
dpos /= rvect(ext.stride());
- if (not (all (abs(dpos) <= rvect(0.5)))) {
+ if (not (all (fabs(dpos) <= rvect(0.5)))) {
cout << "fasterp.cc:659\n"
<< " dpos=" << dpos << "\n"
<< " ext=" << ext << "\n";
}
- assert (all (abs(dpos) <= rvect(0.5)));
+ assert (all (fabs(dpos) <= rvect(0.5)));
ivect const ind = ipos - ext.lower() / ext.stride();
ivect const ash = pad_shape(ext);