[Gridflow-cvs] [svn] commit: r5134 - /trunk/src/gridflow.hxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Wed Mar 17 22:21:19 EDT 2010


Author: matju
Date: Wed Mar 17 22:21:19 2010
New Revision: 5134

Log:
fix [# ** -1]

Modified:
    trunk/src/gridflow.hxx

Modified: trunk/src/gridflow.hxx
==============================================================================
--- trunk/src/gridflow.hxx (original)
+++ trunk/src/gridflow.hxx Wed Mar 17 22:21:19 2010
@@ -105,7 +105,7 @@
 static inline float64 gf_abs(float64 a) {return fabs(a);}
 
 // integer powers in log(b) time. T is assumed Integer
-template <class T> static inline T ipow(T a, T b) {T r=1; for(;;) {if (b&1) r*=a; b>>=1; if (!b) return r; a*=a;}}
+template <class T> static inline T ipow(T a, T b) {T r=1; if (b<0) return 0; for(;;) {if (b&1) r*=a; b>>=1; if (!b) return r; a*=a;}}
 static inline float32 ipow(float32 a, float32 b) {return pow(a,b);}
 static inline float64 ipow(float64 a, float64 b) {return pow(a,b);}
 



More information about the Gridflow-cvs mailing list