aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-05-26 16:18:47 -0400
committerErik Schnetter <schnetter@gmail.com>2013-05-26 16:18:47 -0400
commit339b60e63c9a837d7165339818e61b93716b64e7 (patch)
tree4ecec0d66dae4ad43bcbbc3ce345834ce0ac3851 /Carpet/CarpetLib
parentfa57059414919bea3cd6d7d62b69dc733f8b8f6d (diff)
CarpetLib: Use imod instead of % operator in bbox class
This avoids rounding problems near zero.
Diffstat (limited to 'Carpet/CarpetLib')
-rw-r--r--Carpet/CarpetLib/src/bbox.hh2
1 files changed, 1 insertions, 1 deletions
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<T,D> stride () const { return _stride; }
/** Get offset. */
- vect<T,D> offset () const { return (_lower % _stride + _stride) % _stride; }
+ vect<T,D> offset () const { return imod(_lower, _stride); }
/** Get the shape (or extent). */
vect<T,D> shape () const { return _upper - _lower + _stride; }