summaryrefslogtreecommitdiff
path: root/src/sqr.c
diff options
context:
space:
mode:
authorPhilippe Theveny <philippe.theveny@laposte.net>2008-11-17 10:55:25 +0000
committerPhilippe Theveny <philippe.theveny@laposte.net>2008-11-17 10:55:25 +0000
commit7562d667f884683e4dd238d6a777ced9d368685e (patch)
tree57133ef7faee5884fe537fdebeebc13a735483d5 /src/sqr.c
parentba3aee8ac9e7bfbb65d1b3e6258ca5cb949d7ed6 (diff)
downloadmpc-git-7562d667f884683e4dd238d6a777ced9d368685e.tar.gz
src/sqr.c: Partly revert r321, error of 3 bits in u.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/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)
{