diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/sqr.c | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -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: @@ -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 */ } |