summaryrefslogtreecommitdiff
path: root/complex.c
diff options
context:
space:
mode:
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/complex.c b/complex.c
index c127a2681b..930c4453ec 100644
--- a/complex.c
+++ b/complex.c
@@ -887,7 +887,7 @@ nucomp_expt(VALUE self, VALUE other)
if (r)
break;
- x = f_complex_new2(CLASS_OF(self),
+ x = nucomp_s_new_internal(CLASS_OF(self),
f_sub(f_mul(dat->real, dat->real),
f_mul(dat->imag, dat->imag)),
f_mul(f_mul(TWO, dat->real), dat->imag));
@@ -896,7 +896,10 @@ nucomp_expt(VALUE self, VALUE other)
z = f_mul(z, x);
n--;
}
- return z;
+ {
+ get_dat1(z);
+ return f_complex_new2(CLASS_OF(self), dat->real, dat->imag);
+ }
}
return f_expt(f_reciprocal(self), f_negate(other));
}