diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-07-22 13:26:54 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-07-22 13:26:54 +0000 |
commit | 65e94141e426753037ef5524efe7d37ac6a6387a (patch) | |
tree | 76fe43312a4fc31609cd456c986b453a43e8faec /tests/tadd1sp.c | |
parent | 41a809a1dcc473488920271f9b497a39bcbabd17 (diff) | |
parent | a59dc9a549a0f9aff5cb009e2ea68cd67c9e23fc (diff) | |
download | mpfr-65e94141e426753037ef5524efe7d37ac6a6387a.tar.gz |
Merged r10566 through r10570 from the trunk, resolving the conflict.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/faithful@10650 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tadd1sp.c')
-rw-r--r-- | tests/tadd1sp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/tadd1sp.c b/tests/tadd1sp.c index 599d92eb6..638d57082 100644 --- a/tests/tadd1sp.c +++ b/tests/tadd1sp.c @@ -118,8 +118,12 @@ check_random (mpfr_prec_t p) mpfr_urandomb (c, RANDS); if (MPFR_IS_PURE_FP(b) && MPFR_IS_PURE_FP(c)) { + if (randlimb () & 1) + mpfr_neg (b, b, MPFR_RNDN); + if (randlimb () & 1) + mpfr_neg (c, c, MPFR_RNDN); if (MPFR_GET_EXP(b) < MPFR_GET_EXP(c)) - mpfr_swap(b, c); + mpfr_swap (b, c); if (MPFR_IS_PURE_FP(b) && MPFR_IS_PURE_FP(c)) for (r = 0 ; r < MPFR_RND_MAX ; r++) { @@ -127,9 +131,9 @@ check_random (mpfr_prec_t p) mpfr_add1 and mpfr_add1sp could return different values */ continue; - inexact1 = mpfr_add1(a1, b, c, (mpfr_rnd_t) r); - inexact2 = mpfr_add1sp(a2, b, c, (mpfr_rnd_t) r); - if (mpfr_cmp(a1, a2)) + inexact1 = mpfr_add1 (a1, b, c, (mpfr_rnd_t) r); + inexact2 = mpfr_add1sp (a2, b, c, (mpfr_rnd_t) r); + if (! mpfr_equal_p (a1, a2)) STD_ERROR; if (inexact1 != inexact2) STD_ERROR2; |