From 671c86c079faa37386f59eb3c814dc837c4df4c5 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 2 Apr 2013 18:29:33 -0400 Subject: 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. --- Carpet/CarpetIOBasic/src/iobasic.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Carpet/CarpetIOBasic') 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); } -- cgit v1.2.3