diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2012-02-24 21:38:16 -0500 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2012-09-11 18:23:04 +0100 |
commit | 182a0817d15d082d89907c95316e6176736c2c03 (patch) | |
tree | 3ac3351b539bca02959410c3579d0bb8d0dfc60c /Carpet/CarpetLib/src/bbox.cc | |
parent | daf11c7b68d2dd9d9b8821a5603b39b72b568d20 (diff) |
CarpetLib: Provide idiv/imod functions that always round down
Provide idiv/imod functions for signed integer division that always
round towards negative infinity. Also provide vector version of these.
Use these in the bbox output routines to ensure proper rounding.
Diffstat (limited to 'Carpet/CarpetLib/src/bbox.cc')
-rw-r--r-- | Carpet/CarpetLib/src/bbox.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Carpet/CarpetLib/src/bbox.cc b/Carpet/CarpetLib/src/bbox.cc index 7c942f854..d2ea8dd7d 100644 --- a/Carpet/CarpetLib/src/bbox.cc +++ b/Carpet/CarpetLib/src/bbox.cc @@ -321,7 +321,7 @@ void bbox<T,D>::input (istream& is) { template<typename T,int D> void bbox<T,D>::output (ostream& os) const { os << "(" << lower() << ":" << upper() << ":" << stride() - << "/" << lower() / stride() << ":" << upper() / stride() + << "/" << idiv(lower(), stride()) << ":" << idiv(upper(), stride()) << "/" << shape() / stride() << "/" << size() << ")"; } |