summaryrefslogtreecommitdiff
path: root/src/sqr.c
diff options
context:
space:
mode:
authorthevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2008-11-17 10:55:25 +0000
committerthevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2008-11-17 10:55:25 +0000
commit8e8076b510016f82a5afd289bebbb44436b3af6b (patch)
tree57133ef7faee5884fe537fdebeebc13a735483d5 /src/sqr.c
parent31f73f72700e462ac2cb34b1b88367ca16467fe9 (diff)
downloadmpc-8e8076b510016f82a5afd289bebbb44436b3af6b.tar.gz
src/sqr.c: Partly revert r321, error of 3 bits in u.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@322 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'src/sqr.c')
-rw-r--r--src/sqr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sqr.c b/src/sqr.c
index 80ae2fd..8a29c86 100644
--- a/src/sqr.c
+++ b/src/sqr.c
@@ -160,7 +160,7 @@ mpc_sqr (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
else if (mpfr_sgn (u) * mpfr_sgn (v) > 0)
{
inexact |= mpfr_mul (u, u, v, GMP_RNDU); /* error 5 */
- ok = !inexact | mpfr_can_round (u, prec - 5, GMP_RNDU, GMP_RNDZ,
+ ok = !inexact | mpfr_can_round (u, prec - 3, GMP_RNDU, GMP_RNDZ,
MPFR_PREC (MPC_RE (rop)) + (MPC_RND_RE (rnd) == GMP_RNDN));
if (ok)
{
@@ -173,7 +173,7 @@ mpc_sqr (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
else
{
inexact |= mpfr_mul (u, u, v, GMP_RNDD); /* error 5 */
- ok = !inexact | mpfr_can_round (u, prec - 5, GMP_RNDD, GMP_RNDZ,
+ ok = !inexact | mpfr_can_round (u, prec - 3, GMP_RNDD, GMP_RNDZ,
MPFR_PREC (MPC_RE (rop)) + (MPC_RND_RE (rnd) == GMP_RNDN));
if (ok)
{