Base: fix __pow__ operator in MatrixPy/PlacementPy/RotationPy

This commit is contained in:
Zheng, Lei
2019-09-29 17:36:07 +08:00
committed by wmayer
parent c5fd45f762
commit b2ba93c4fc
3 changed files with 13 additions and 7 deletions

View File

@@ -363,11 +363,11 @@ PyObject * PlacementPy::number_power_handler (PyObject* self, PyObject* other, P
return new PlacementPy(Placement());
if(b < 0) {
b = 1+b;
b = -b;
a.invert();
}
auto res = a;
for(;b;--b)
for(--b;b;--b)
res *= a;
return new PlacementPy(res);
}