fix cpow_ii
This commit is contained in:
parent
8d13822a4c
commit
d532b5bcec
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue