summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--src/sqr.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index b278408..0ec08bd 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,7 @@ Recent changes:
- Bug fixes:
- mul now returns correct results even if there are over- or underflows
during the computation
- - asin, proj: wrong result when input variable has infinite part and
+ - asin, proj, sqr: wrong result when input variable has infinite part and
equals output variable
Changes in version 0.9:
diff --git a/src/sqr.c b/src/sqr.c
index a324f15..07f9631 100644
--- a/src/sqr.c
+++ b/src/sqr.c
@@ -42,26 +42,26 @@ mpc_sqr (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
}
else if (mpfr_inf_p (MPC_RE (op))) {
if (mpfr_inf_p (MPC_IM (op))) {
- mpfr_set_nan (MPC_RE (rop));
mpfr_set_inf (MPC_IM (rop),
MPFR_SIGN (MPC_RE (op)) * MPFR_SIGN (MPC_IM (op)));
+ mpfr_set_nan (MPC_RE (rop));
}
else {
- mpfr_set_inf (MPC_RE (rop), +1);
if (mpfr_zero_p (MPC_IM (op)))
mpfr_set_nan (MPC_IM (rop));
else
mpfr_set_inf (MPC_IM (rop),
MPFR_SIGN (MPC_RE (op)) * MPFR_SIGN (MPC_IM (op)));
+ mpfr_set_inf (MPC_RE (rop), +1);
}
}
else /* IM(op) is infinity, RE(op) is not */ {
- mpfr_set_inf (MPC_RE (rop), -1);
if (mpfr_zero_p (MPC_RE (op)))
mpfr_set_nan (MPC_IM (rop));
else
mpfr_set_inf (MPC_IM (rop),
MPFR_SIGN (MPC_RE (op)) * MPFR_SIGN (MPC_IM (op)));
+ mpfr_set_inf (MPC_RE (rop), -1);
}
return MPC_INEX (0, 0); /* exact */
}