aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/defs.cc
diff options
context:
space:
mode:
authorschnetter <>2004-05-21 16:13:00 +0000
committerschnetter <>2004-05-21 16:13:00 +0000
commit9300e0e16a8f2bd6e5f1f9bc1aafda301ef59f0f (patch)
tree0ea39f63e924aeef0d86a461f0b183631536c029 /Carpet/CarpetLib/src/defs.cc
parent0cef68415285da326195485a1571f564a5e7a672 (diff)
Add option to use less memory during regridding.
Add option to use less memory during regridding. Some more internal consistency checks. Some reformatting. darcs-hash:20040521161341-07bb3-de11e460fb175d3dbbd94708730c18a6e94e370a.gz
Diffstat (limited to 'Carpet/CarpetLib/src/defs.cc')
-rw-r--r--Carpet/CarpetLib/src/defs.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/Carpet/CarpetLib/src/defs.cc b/Carpet/CarpetLib/src/defs.cc
index 28aaf0539..69cd22fca 100644
--- a/Carpet/CarpetLib/src/defs.cc
+++ b/Carpet/CarpetLib/src/defs.cc
@@ -1,4 +1,4 @@
-// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/defs.cc,v 1.18 2004/01/25 14:57:29 schnetter Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/defs.cc,v 1.19 2004/05/21 18:13:41 schnetter Exp $
#include <assert.h>
#include <ctype.h>
@@ -24,10 +24,11 @@ T ipow (T x, int y) {
x = T(1)/x;
}
T res = T(1);
- while (y>0) {
+ for (;;) {
if (y%2) res *= x;
- x *= x;
y /= 2;
+ if (y==0) break;
+ x *= x;
}
return res;
}