summaryrefslogtreecommitdiff
path: root/src/pow.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pow.c')
-rw-r--r--src/pow.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pow.c b/src/pow.c
index ec9620a..25e2d1b 100644
--- a/src/pow.c
+++ b/src/pow.c
@@ -702,7 +702,12 @@ mpc_pow (mpc_ptr z, mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
if (mpfr_inf_p (mpc_realref (z)))
inex_re = mpc_fix_inf (mpc_realref (z), MPC_RND_RE(rnd));
if (mpfr_inf_p (mpc_imagref (z)))
- inex_im = mpc_fix_inf (mpc_imagref (z), MPC_RND_IM(rnd));
+ {
+ if (z_real)
+ inex_im = mpfr_set_ui (mpc_imagref (z), 0, MPC_RND_IM(rnd));
+ else
+ inex_im = mpc_fix_inf (mpc_imagref (z), MPC_RND_IM(rnd));
+ }
ret = MPC_INEX(inex_re,inex_im);
goto exact;
}