fix cpow_ii

This commit is contained in:
martin-frbg 2022-04-14 08:25:32 +02:00
parent 8d13822a4c
commit d532b5bcec
1 changed files with 1 additions and 1 deletions

View File

@ -295,7 +295,7 @@ static double dpow_ui(double x, integer n) {
static _Fcomplex cpow_ui(_Fcomplex x, integer n) { static _Fcomplex cpow_ui(_Fcomplex x, integer n) {
_Fcomplex pow={1.0,0.0}; unsigned long int u; _Fcomplex pow={1.0,0.0}; unsigned long int u;
if(n != 0) { if(n != 0) {
if(n < 0) n = -n, x.r = 1/x.r, x.i=1/x.i; if(n < 0) n = -n, x._Val[0] = 1./x._Val[0], x._Val[1]=1./x._Val[1];
for(u = n; ; ) { for(u = n; ; ) {
if(u & 01) pow = _FCmulcc (pow,x); if(u & 01) pow = _FCmulcc (pow,x);
if(u >>= 1) x = _FCmulcc (x,x); if(u >>= 1) x = _FCmulcc (x,x);