diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-04-02 18:29:33 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-04-02 18:29:33 -0400 |
commit | 671c86c079faa37386f59eb3c814dc837c4df4c5 (patch) | |
tree | 0cf5baa5bb9dc44a05c0b8ea78d867c17d8c1e49 /Carpet/CarpetIOBasic | |
parent | c0c03fece68597fddfef57948334c5c99154f244 (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/CarpetIOBasic')
-rw-r--r-- | Carpet/CarpetIOBasic/src/iobasic.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Carpet/CarpetIOBasic/src/iobasic.cc b/Carpet/CarpetIOBasic/src/iobasic.cc index 5dd668091..78e372ba7 100644 --- a/Carpet/CarpetIOBasic/src/iobasic.cc +++ b/Carpet/CarpetIOBasic/src/iobasic.cc @@ -81,9 +81,7 @@ namespace CarpetIOBasic { { DECLARE_CCTK_PARAMETERS; - static_assert (abs(0.1) > 0, "Function abs has wrong signature"); - - CCTK_REAL const xa = abs (x); + CCTK_REAL const xa = fabs (x); return xa != 0 and (xa < real_min or xa >= real_max); } |