diff options
author | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2008-04-11 13:54:32 +0000 |
---|---|---|
committer | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2008-04-11 13:54:32 +0000 |
commit | 8adb31d6f2b006dc21545e754d09f0714204dbca (patch) | |
tree | 6754b2561107fef0603944d16de809eae30bba62 /tests/tdiv.c | |
parent | 545dd3cc85cbe29a7b9cdcb72677e0c07466011e (diff) | |
download | mpc-8adb31d6f2b006dc21545e754d09f0714204dbca.tar.gz |
eliminated comparisons between signed and unsigned
mainly by casting precisions (unsigned) to mp_exp_t (signed)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@105 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'tests/tdiv.c')
-rw-r--r-- | tests/tdiv.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/tdiv.c b/tests/tdiv.c index ef3ac3d..213e4e7 100644 --- a/tests/tdiv.c +++ b/tests/tdiv.c @@ -34,9 +34,9 @@ int mpc_div_ref (mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t); int mpc_div_ref (mpc_ptr a, mpc_srcptr b, mpc_srcptr c, mpc_rnd_t rnd) { - int ok = 0, inexact_q, inex_re, inex_im = 0, cancel = 0, err, sgn; + int ok = 0, inexact_q, inex_re, inex_im = 0, cancel = 0, sgn; mpfr_t u, v, q, t; - mp_prec_t prec; + mp_prec_t prec, err; mp_rnd_t rnd_re, rnd_im; if (mpfr_cmp_ui (MPC_IM(c), 0) == 0) /* c is real */ @@ -88,7 +88,7 @@ mpc_div_ref (mpc_ptr a, mpc_srcptr b, mpc_srcptr c, mpc_rnd_t rnd) cancel = MPFR_EXP(u) - MPFR_EXP(t); else { - cancel = (MPFR_IS_ZERO(t)) ? prec + cancel = (MPFR_IS_ZERO(t)) ? (mp_exp_t) prec : MAX(MPFR_EXP(u), MPFR_EXP(v)) - MPFR_EXP(t); } /* err(t) <= [1 + 2*2^cancel] ulp(t) */ @@ -168,7 +168,7 @@ mpc_div_ref (mpc_ptr a, mpc_srcptr b, mpc_srcptr c, mpc_rnd_t rnd) else if (MPFR_IS_ZERO(v)) cancel = MPFR_EXP(u) - MPFR_EXP(t); else - cancel = (MPFR_IS_ZERO(t)) ? prec + cancel = (MPFR_IS_ZERO(t)) ? (mp_exp_t) prec : MAX(MPFR_EXP(u), MPFR_EXP(v)) - MPFR_EXP(t); /* err(t) <= [1 + 2*2^cancel] ulp(t) */ inex_re |= mpfr_div (t, t, q, rnd_re) || inexact_q; @@ -276,7 +276,7 @@ main() mpc_set_prec (q, prec); mpc_set_prec (q_ref, prec); - for (i = 0; i < 1000/prec; i++) + for (i = 0; i < (int) (1000/prec); i++) { mpc_random (b); /* generate a non-zero divisor */ |