From 339b60e63c9a837d7165339818e61b93716b64e7 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 26 May 2013 16:18:47 -0400 Subject: CarpetLib: Use imod instead of % operator in bbox class This avoids rounding problems near zero. --- Carpet/CarpetLib/src/bbox.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Carpet/CarpetLib/src') diff --git a/Carpet/CarpetLib/src/bbox.hh b/Carpet/CarpetLib/src/bbox.hh index 85af2fcd3..2646cb971 100644 --- a/Carpet/CarpetLib/src/bbox.hh +++ b/Carpet/CarpetLib/src/bbox.hh @@ -110,7 +110,7 @@ public: vect stride () const { return _stride; } /** Get offset. */ - vect offset () const { return (_lower % _stride + _stride) % _stride; } + vect offset () const { return imod(_lower, _stride); } /** Get the shape (or extent). */ vect shape () const { return _upper - _lower + _stride; } -- cgit v1.2.3